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

  • Change the download 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

  • This is a known issue and currently being tracked under Red Hat Jira SAT-43249.

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