Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
I have enabled the following repositories and triggered sync for the first time on all 4 of them simultaneously.
Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8
Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs 8
Red Hat Enterprise Linux 8 for x86_64 - AppStream Kickstart 8.7
Red Hat Enterprise Linux 8 for x86_64 - BaseOS Kickstart 8.7
Only 'Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs 8' sync failed with the following error.
PG::ForeignKeyViolation: ERROR: insert or update on table "katello_repository_rpms" violates foreign key constraint "fk_rails_39a260fd51"
DETAIL: Key (rpm_id)=(5304) is not present in table "katello_rpms".
Res-sync of the above repository fixed the issue. I can't reproduce it for RHEL 9 same set repositories.
Looking at the error and failure in index action when reproducing, the reason the RPM might have been deleted before a RepositoryRPM is created as the error says is because we had a delete_orphan task being invoked in index_action which would delete all content which hadn't been associated to a repository. Looks like a race condition side effect from that.
We have removed delete_orphan from index action in snap 8 as part of this BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2221291 so this should be resolved. Currently testing on a second snap 8 instance.
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.14 security and 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-2023:6818