Bug 2103246 - Capsule sync fails with duplicate key value violates unique constraint "core_repositoryversion_repository_id_number
Summary: Capsule sync fails with duplicate key value violates unique constraint "core_...
Keywords:
Status: CLOSED DUPLICATE of bug 2077363
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.10.6
Hardware: x86_64
OS: Linux
high
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-01 18:52 UTC by Ricardo Santamaria
Modified: 2023-09-18 04:40 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-04 23:44:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pulp pulp_rpm issues 2278 0 None closed "duplicate key value violates unique constraint" when syncing two repositories with identical sub-repositories in parall... 2022-11-16 14:07:24 UTC
Github pulp pulpcore issues 3135 0 None closed Repository sync fails with duplicate key value violates unique constraint "core_repositoryversion_repository_id_number 2022-11-04 23:43:26 UTC
Red Hat Issue Tracker SAT-12451 0 None None None 2022-08-25 03:59:17 UTC

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


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