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 2077046 - Upgrade fails during db:migrate with PG::ForeignKeyViolation: ERROR: update or delete on table "katello_errata" violates foreign key constraint "katello_content_facet_errata_errata_id"
Summary: Upgrade fails during db:migrate with PG::ForeignKeyViolation: ERROR: update ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Errata Management
Version: 6.10.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.10.5
Assignee: satellite6-bugs
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On: 2075519
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-20 14:35 UTC by Lukas Pramuk
Modified: 2022-05-04 12:59 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2075519
Environment:
Last Closed: 2022-05-04 12:59:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34771 0 Normal Closed Katello upgrade from 4.4 to 4.4.0.2 still fails during remove duplicate errata 2022-04-21 12:54:49 UTC
Red Hat Product Errata RHSA-2022:1708 0 None None None 2022-05-04 12:59:20 UTC

Comment 3 Lukas Pramuk 2022-04-20 14:39:37 UTC
The similar upgrade issue is on 6.10.5 Snap1 with slightly different error message:


2022-04-20 09:59:03 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: PG::ForeignKeyViolation: ERROR:  update or delete on table "katello_errata" violates foreign key constraint "katello_erratum_bugzillas_errata_id_fk" on table "katello_erratum_bugzillas"
2022-04-20 09:59:03 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: DETAIL:  Key (id)=(11658) is still referenced from table "katello_erratum_bugzillas".

Comment 4 Lukas Pramuk 2022-04-20 14:58:20 UTC
# foreman-rake db:migrate
'ErbParser' is ignored.
'RubyParser' is ignored.
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
== 20220303160220 RemoveDuplicateErrata: migrating ============================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::ForeignKeyViolation: ERROR:  update or delete on table "katello_errata" violates foreign key constraint "katello_erratum_bugzillas_errata_id_fk" on table "katello_erratum_bugzillas"
DETAIL:  Key (id)=(11658) is still referenced from table "katello_erratum_bugzillas".
...

>>> so it is the same migration file as in original 6.11.0 BZ

Comment 5 Lukas Pramuk 2022-04-23 12:04:09 UTC
VERIFIED.

@Satellite 6.10.5 Snap2
tfm-rubygem-katello-4.1.1.55-1.el7sat.noarch

by the following manual reproducer:

1) Have QE upgrade template Satellite 6.10 (or fresh 6.10 and sync RHEL repositories)

2) Upgrade to 6.10.5

# satellite-maintain upgrade run --target-version 6.10.z -y
...

--------------------------------------------------------------------------------
Unlock packages:                                                      [OK]
--------------------------------------------------------------------------------
Update package(s) :                                                   [OK]
--------------------------------------------------------------------------------
Procedures::Installer::Upgrade:                                       [OK]
--------------------------------------------------------------------------------
Execute upgrade:run rake task:                                        [OK]
--------------------------------------------------------------------------------
...

--------------------------------------------------------------------------------
Upgrade finished.


>>> db:migrate finished successfully so the upgrade did

Comment 10 errata-xmlrpc 2022-05-04 12:59:16 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 (Important: Satellite 6.10.5 Async Bug Fix Update), 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-2022:1708


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