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 2103246

Summary: Capsule sync fails with duplicate key value violates unique constraint "core_repositoryversion_repository_id_number
Product: Red Hat Satellite Reporter: Ricardo Santamaria <risantam>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Vladimír Sedmík <vsedmik>
Severity: high Docs Contact:
Priority: high    
Version: 6.10.6CC: ahumbe, aruzicka, dalley, dkliban, ggainey, rchan
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-04 23:44:56 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 Ricardo Santamaria 2022-07-01 18:52:39 UTC
When attempts to sync capulse with 8 pulpcore workers sync gets: 

duplicate key value violates unique constraint "core_repositoryversion_repository_id_number_3c54ce50_uniq"
DETAIL:  Key (repository_id, number)=(8483dc67-8401-47ba-bb80-203f5a9c0429, 2) already exists.
duplicate key value violates unique constraint "core_repositoryversion_repository_id_number_3c54ce50_uniq"
DETAIL:  Key (repository_id, number)=(cb12fe97-4c5f-4424-a1ee-e4ff550dd46f, 2) already exists.
duplicate key value violates unique constraint "core_repositoryversion_repository_id_number_3c54ce50_uniq"
DETAIL:  Key (repository_id, number)=(8483dc67-8401-47ba-bb80-203f5a9c0429, 2) already exists.

Workaround provided in article https://access.redhat.com/solutions/6718181 solves this by:

1. Stop all but 1 worker on the affected Capsule servers:
    
   # for i in {2..8} ; do systemctl stop pulpcore-worker@${i}; done

2. Verify all but 1 worker is stopped:

   # for i in {1..8} ; do systemctl status pulpcore-worker@${i} | grep Active; done

3. After that trigger an Optimized Capsule sync against the affected Capsules.

Comment 6 pulp-infra@redhat.com 2022-11-16 14:07:25 UTC
The Pulp upstream bug status is at closed. Updating the external tracker on this bug.

Comment 7 Red Hat Bugzilla 2023-09-18 04:40:56 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days