RHEL 9 AppStream repository synchronization on Red Hat Satellite 6 fails with duplicate key value error

Solution Verified - Updated -

Environment

  • Red Hat Satellite 6

Issue

  • Repository sync failing for RHEL 9 AppStream with following error:

    duplicate key value violates unique constraint "core_publishedartifact_publication_id_relative__97f785f4_uniq"
    DETAIL:  Key (publication_id, relative_path)=(019cc43d-66e0-7ff0-b309-1b63f8cf6c73, Packages/p/pg_repack-1.4.8-2.module+el9.5.0+22224+f5585c78.x86_64.rpm) already exists.
    

Resolution

  • The issue has been resolved by RHELDST-37695, by correcting the cached data on the akamai servers.

  • The RHEL 9 AppStream repository should no longer have any issues syncing.

  • If you are still seeing issues, please open a support ticket, provide the error you are seeing and mention this KCS for further investigation.


Previous Workaround (No longer required)

  • Change the mirroring policy from Complete Mirroring to Additive:

    From the Red Hat Satellite Web UI --> Content --> Products --> click on product 'Red Hat Enterprise Linux for x86_64' --> Repositories -> Click on RHEL 9 AppStream repository --> update 'Mirroring Policy' to 'Additive' --> Save.
    
  • Sync the repository.

Root Cause

The repositories were in an inconsistent state due to an unexpected conflict between modular RPM builds and the release process. The release process has been corrected, but the errors were still initially seen due to the previously incorrect state being persistently cached.

Diagnostic Steps

  • Repository sync fails with following error and same can be observed under /var/log/foreman/production.log:

    duplicate key value violates unique constraint "core_publishedartifact_publication_id_relative__97f785f4_uniq"
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments