Bug 1660497

Summary: sometimes RHEL8 Beta sync fails: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "katello_module_stream_artifacts_name_mod_stream_id_uniq"
Product: Red Hat Satellite Reporter: Jan Hutař <jhutar>
Component: RepositoriesAssignee: John Mitsch <jomitsch>
Status: CLOSED ERRATA QA Contact: Jan Hutař <jhutar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: daviddavis, mmccune, zhunting
Target Milestone: 6.5.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.10.0.6-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:39:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
syn task which ended in stopped/warning -> Errors tab none

Description Jan Hutař 2018-12-18 13:09:41 UTC
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):
satellite-6.5.0-5.beta.el7sat.noarch (snap 8)


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


Additional info:
# hammer repository list
---|-------------------------------------------------------------------|-----------------------------------------------------|--------------|---------------------------------------------------------------------------------
ID | NAME                                                              | PRODUCT                                             | CONTENT TYPE | URL                                                                             
---|-------------------------------------------------------------------|-----------------------------------------------------|--------------|---------------------------------------------------------------------------------
7  | bewsLYwxKsNPNwM                                                   | bUJpiBwSsPMrIlVzoVUq                                | puppet       | http://omaciel.fedorapeople.org/bagoftricks                                     
8  | eOwfdHsrBRDhQtR                                                   | IYdzksIZtvKGuEpERXSI                                | yum          | http://.../pulp/repos/Sat6-CI/QA/Tools_6_4_wi...
9  | FvbmrVdxxedikyl                                                   | FgiAEmNFKzOrTTalNzCB                                | yum          | http://.../pulp/repos/Sat6-CI/QA/Tools_6_4_wi...
3  | Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.2            | Red Hat Enterprise Linux Server                     | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7.2/x86_64/kickstart          
2  | Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.6            | Red Hat Enterprise Linux Server                     | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7.6/x86_64/kickstart          
11 | Red Hat Enterprise Linux 7 Server - RH Common RPMs x86_64 7Server | Red Hat Enterprise Linux Server                     | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/rh-common/os   
1  | Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server             | Red Hat Enterprise Linux Server                     | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os             
34 | Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta Kickstart  | Red Hat Enterprise Linux for x86_64 Beta            | yum          | https://cdn.redhat.com/content/beta/rhel8/8/x86_64/appstream/kickstart          
35 | Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta RPMs       | Red Hat Enterprise Linux for x86_64 Beta            | yum          | https://cdn.redhat.com/content/beta/rhel8/8/x86_64/appstream/os                 
37 | Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB Kickstart   | Red Hat Enterprise Linux for x86_64 High Touch Beta | yum          | https://cdn.redhat.com/content/htb/rhel8/8/x86_64/appstream/kickstart           
36 | Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB RPMs        | Red Hat Enterprise Linux for x86_64 High Touch Beta | yum          | https://cdn.redhat.com/content/htb/rhel8/8/x86_64/appstream/os                  
30 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta Kickstart     | Red Hat Enterprise Linux for x86_64 Beta            | yum          | https://cdn.redhat.com/content/beta/rhel8/8/x86_64/baseos/kickstart             
31 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta RPMs          | Red Hat Enterprise Linux for x86_64 Beta            | yum          | https://cdn.redhat.com/content/beta/rhel8/8/x86_64/baseos/os                    
32 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB Kickstart      | Red Hat Enterprise Linux for x86_64 High Touch Beta | yum          | https://cdn.redhat.com/content/htb/rhel8/8/x86_64/baseos/kickstart              
33 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB RPMs           | Red Hat Enterprise Linux for x86_64 High Touch Beta | yum          | https://cdn.redhat.com/content/htb/rhel8/8/x86_64/baseos/os                     
4  | RHEL7Tools                                                        | SatTools                                            | yum          | http://.../pulp/repos/Sat6-CI/QA/Tools_6_5_wit...
5  | TRMVanFNECURUEI                                                   | gZfFSbDpIdqvCiIONCUz                                | puppet       | http://omaciel.fedorapeople.org/bagoftricks                                     
10 | WsAyENogqxdYngr                                                   | MVCNSxqFTRNtbmZZzaAN                                | puppet       | http://omaciel.fedorapeople.org/bagoftricks                                     
6  | ZFZgocwinzfDacu                                                   | dLYJwUtszyZjkyilOXhz                                | puppet       | http://omaciel.fedorapeople.org/bagoftricks                                     
---|-------------------------------------------------------------------|-----------------------------------------------------|--------------|---------------------------------------------------------------------------------

Comment 2 Jan Hutař 2018-12-18 13:11:06 UTC
Created attachment 1515336 [details]
syn task which ended in stopped/warning -> Errors tab

Comment 5 John Mitsch 2019-01-03 19:47:17 UTC
Created redmine issue https://projects.theforeman.org/issues/25774 from this bug

Comment 6 Bryan Kearney 2019-01-07 21:18:03 UTC
Upstream bug assigned to jomitsch

Comment 7 Bryan Kearney 2019-01-07 21:18:04 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25774 has been resolved.

Comment 12 errata-xmlrpc 2019-05-14 12:39:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222