Repo sync fails with warning, no content added

Problem:
My BaseOS x86_64 os from Rocky ( Index of /pub/rocky/9/BaseOS/x86_64/os/ ) refuses to sync no mater what I do.

I’ve attempted the following to get it to sync…
optimized sync
advanced sync
delete the repo recreate it via “repo discovery”
create it via “add repo”
added it to a view
not added to a view
deleted it via CLI and the GUI
recreated it with a different name
changed the upstream provider from rockylinux.org to rackspace
Updated from Foreman 3.1 & Katello 4.3 to Foreman 3.4 and Katello 4.6
Up the vCPU from 34 to 48
up the vRAM from 32gb to 64gb
changed mirroring policy from Additive to Complete Mirroring
changed Download policy from Immediate to On Demand

No mater what I’ve tried I always end up with a error that looks the same ( not sure if the repository_id changes though )

duplicate key value violates unique constraint “core_repositoryversion_repository_id_number_3c54ce50_uniq”
DETAIL: Key (repository_id, number)=(54fece9b-1361-499d-8a7c-f22b99930b73, 3) already exists.

Expected outcome:
Repo should sync correctly.

Foreman and Proxy versions:
Foreman 3.4 and Katello 4.6

Distribution and version:
Rocky Linux 8.6

Other relevant data:

When attempting to sync this is the “details” box

No content added.
Total steps: 1177/1177

Associating Content: 0/0
Downloading Artifacts: 1/1
Downloading Metadata Files: 5/5
Parsed Comps: 41/41
Parsed Packages: 1130/1130

Possibly related to underlying problem in “Sync errors on all syncs including the initial sync between new katello server and content proxy”.

1 Like

Do you remember cleaning up the repo using delete_orphaned_content or similar earlier? This might be related to similar issues we have seen when syncing baseOS brings in Appstream repo in the background but deletion doesn’t clean up the Appstream repo causing such issues.

I have not cleaned this repo ever.

I have cleaned repos under a different OS ( Rocky 8.5 ) but never for Rocky 9

il try to run the delete_orphaned_content and report back

And just ran the delete orphaned content and I am still getting the same error

duplicate key value violates unique constraint “core_repositoryversion_repository_id_number_3c54ce50_uniq”
DETAIL: Key (repository_id, number)=(54fece9b-1361-499d-8a7c-f22b99930b73, 3) already exists.

Tracking here Repository sync fails with duplicate key value violates unique constraint "core_repositoryversion_repository_id_number · Issue #3135 · pulp/pulpcore · GitHub