Bug #25774
closedsometimes RHEL8 Beta sync fails: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "katello_module_stream_artifacts_name_mod_stream_id_uniq"
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1660497
Description of problem:
sometimes RHEL8 Beta sync fails: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "katello_module_stream_artifacts_name_mod_stream_id_uniq"
Version-Release number of selected component (if applicable):
Katello 3.10
How reproducible:
sometimes
Steps to Reproduce:
1. I have started sync of these 4 repos:
Content -> Sync Status
Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta Kickstart
Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta RPMs
Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta Kickstart
Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta RPMs
2. Other than that I have also same set of HTB repos enabled (but have not synced it yet)
Actual results:
One of sync tasks fails with warning:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "katello_module_stream_artifacts_name_mod_stream_id_uniq"
DETAIL: Key (module_stream_id, name)=(1, rust-doc-0:1.26.2-12.el8+2011+e949f8f2.x86_64) already exists.
: INSERT INTO "katello_module_stream_artifacts" ("module_stream_id", "name", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"
When I rerun sync on that single repo, it works.
Expected results:
Should work on a first try