Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1401455 - "ERROR: current transaction is aborted, commands ignored until end of transaction block" on katello_pools table query
Summary: "ERROR: current transaction is aborted, commands ignored until end of transa...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: 6.2.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-05 10:32 UTC by Roman Plevka
Modified: 2023-03-24 13:44 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
katello_pools PG error traceback (18.13 KB, text/plain)
2017-11-29 10:55 UTC, Roman Plevka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 20788 0 Normal Closed "ERROR: current transaction is aborted, commands ignored until end of transaction block" on katello_pools table query 2020-08-19 02:50:13 UTC

Description Roman Plevka 2016-12-05 10:32:00 UTC
Description of problem:
There seems to be some error involving `katello_pools` table causing a transaction error, causing further queries to fail with:

# happened on product create
2016-12-03 23:59:01 [app] [E] ForemanTasks::TaskError: Task 98445faf-2e97-480f-824c-258d98a1f359: ActiveRecord::StatementInvalid: PG::Error: ERROR:  current transaction is aborted, commands ignored until end of transaction block
 | : SELECT  "katello_pools".* FROM "katello_pools"  WHERE "katello_pools"."cp_id" = '8a93a2a558c7956b0158c83313da12d6'  ORDER BY "katello_pools"."id" ASC LIMIT 1


I've not been able to manually reproduce the issue, however our automation hits the issue quite often (at different places) so I'm attaching the foreman-debug tarball.
According the production.log, all the occurrences involve querying the `katello_pools` table and seem to happen during Product manipulation.


Version-Release number of selected component (if applicable):
satellite 6.2.5 snap2

How reproducible:
unsure

Comment 12 Brad Buckingham 2017-08-29 11:43:50 UTC
Created redmine issue http://projects.theforeman.org/issues/20788 from this bug

Comment 13 Roman Plevka 2017-09-05 15:23:05 UTC
recent automation run into this in setupClass, which revealed interesting information.

It seems that after the race condition is hit, there already is Katello AR created for the product, yet it does not exist Candlepin (and never will be, since the dynflow task errored out).
This generates inconsistency and every user interaction with the product in katello results in error in candlepin, as the product does not exist there (not the missing product id in the uri [/products//content]):

2017-09-01 16:27:36,267 [thread=http-bio-8443-exec-6] [req=3fbe3a67-91d0-4f10-864c-aaf172412553, org=] ERROR org.candlepin.common.exceptions.mappers.CandlepinExceptionMapper - Runtime Error RESTEASY001185: Could not find resource for 
org.jboss.resteasy.spi.NotFoundException: RESTEASY001185: Could not find resource for relative : /products//content/15042976562127485393238 of full path: https://localhost:8443/candlepin/products//content/15042976562127485393238?enabl
ยป_______at org.jboss.resteasy.core.registry.PathParamSegment.matchPattern(PathParamSegment.java:209) ~[resteasy-jaxrs-2.3.10.Final.jar:na]

- I did some googling around 'RESTEASY001185' and found many bugs and google group threads discussing this error mainly after upgrades (for repos and subscriptions).

I believe they're all caused by the similar race conditions - I guess the dynflow tasks should assure atomicity of the actions in the task.

Comment 18 Satellite Program 2017-09-22 18:07:19 UTC
Upstream bug assigned to jsherril

Comment 19 Satellite Program 2017-09-22 18:07:24 UTC
Upstream bug assigned to jsherril

Comment 20 Satellite Program 2017-09-25 16:07:11 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20788 has been resolved.

Comment 24 Justin Sherrill 2017-11-28 14:24:14 UTC
Roman, is there any traceback associated with the error?

Comment 25 Roman Plevka 2017-11-29 10:55:56 UTC
Created attachment 1360260 [details]
katello_pools PG error traceback

@Justin, here it is (attachment)

Comment 26 Satellite Program 2018-02-21 16:54:17 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.