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.

Bug 2154289

Summary: pulp can break uniq index "rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq" in some way
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Vladimír Sedmík <vsedmik>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.11.4CC: dalley, lwhitty, rbram, saydas
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-05 14:59:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Moravec 2022-12-16 14:15:54 UTC
Description of problem:
There are reports where Satellite upgrade from 6.11 to 6.12 are blocked by:

duplicate key value violates unique constraint "rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq"

error. That happens when rpm_modulemd table in pulpcore DB has entries violating uniq index rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq .

See https://access.redhat.com/solutions/6988715 for more and for manual remedy steps (error-prone, with big exclamation mark "on your own risk").

We dont have a reproducer, nor an idea how to force postgres to have violated an uniq index. An update of Satellite from 6.11.1ish to 6.11.[3-4] *might* be in charge, as far as I recall. I am glad to help finding a reproducer once I get some hint from pulp engineering. But at the end, we need (in this ordering):

1) have some safe steps to identify and recover from the "broken index".
2) fix the bug triggering the index violation

It is trivial to identify the issue - just try

REINDEX INDEX rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq;

within pulpcore DB. But remedy steps.. well, see the KCS.


Version-Release number of selected component (if applicable):
6.11


How reproducible:
unknown atm


Steps to Reproduce:
???


Actual results:
have a Satellite 6.11 with pulpcore DB violating one index, which prevents upgrade to 6.12


Expected results:
- Remedy steps from violated index state
- Prevent getting to the index violation


Additional info:
See https://bugzilla.redhat.com/show_bug.cgi?id=2044631#c52 for another instance / possibly duplicate BZ https://bugzilla.redhat.com/show_bug.cgi?id=2142270 .

Comment 1 Pavel Moravec 2022-12-16 14:28:24 UTC
As I read https://bugzilla.redhat.com/show_bug.cgi?id=2142270 more, I think it is a match / this BZ is dup.

Comment 4 Pavel Moravec 2023-01-05 14:59:28 UTC

*** This bug has been marked as a duplicate of bug 2142270 ***