Project

General

Profile

Bug #20788

"ERROR: current transaction is aborted, commands ignored until end of transaction block" on katello_pools table query

Added by Brad Buckingham about 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Subscriptions
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1401455

Description of problem:
There seems to be some error involving `katello_pools` table causing a transaction error, causing further queries to fail with:

  1. 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

Associated revisions

Revision 4aebbb91 (diff)
Added by Justin Sherrill almost 4 years ago

Fixes #20788 - move sub indexing to run phase

Subscription indexing uses our active record retry
to re-attempt indexing during errors (such as a race
condition where first_or_create fails, because it already
exists). However when this is used in plan or finalize phases
it is executing in a db transaction. When such a race condition
occurs, the transaction becomes aborted and the task fails. Requiring
the user to resume.

By moving it to the run phase, we are moving it out of a db transaction.
Because this changes the ordering of the steps, we will also move the
saving of cp_id into the run phase so it occurs prior to subscription
indexing, since we map products to subscriptions

History

#1 Updated by Brad Buckingham about 4 years ago

  • Subject changed from "ERROR: current transaction is aborted, commands ignored until end of transaction block" on katello_pools table query to "ERROR: current transaction is aborted, commands ignored until end of transaction block" on katello_pools table query
  • Target version set to 213

#2 Updated by John Mitsch about 4 years ago

  • Legacy Backlogs Release (now unused) set to 250

#3 Updated by Brad Buckingham about 4 years ago

  • Target version changed from 213 to 217

#4 Updated by Justin Sherrill about 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Justin Sherrill

#5 Updated by The Foreman Bot about 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6969 added

#6 Updated by Justin Sherrill almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF