Bug 1319309 - duplicate key value violates unique constraint errors
Summary: duplicate key value violates unique constraint errors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: Unspecified
Assignee: John Mitsch
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-18 19:09 UTC by John Mitsch
Modified: 2019-09-25 21:17 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 09:28:00 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1501 normal SHIPPED_LIVE Red Hat Satellite 6.2 Capsule and Server 2016-07-27 12:28:58 UTC
Foreman Issue Tracker 13085 None None None 2016-04-22 15:38:05 UTC

Description John Mitsch 2016-03-18 19:09:10 UTC
This seems to be related to rails 4, errors that look like

PG::Error: ERROR:  duplicate key value violates unique constraint "index_katello_repository_package_groups_on_pgid_repoid"
DETAIL:  Key (package_group_id, repository_id)=(3, 2) already exists.
: INSERT INTO katello_repository_package_groups (package_group_id, repository_id, created_at, updated_at) VALUES (3, 2, '2016-01-08 14:28:11 UTC', '2016-01-08 14:28:11 UTC'), (4, 2, '2016-01-08 14:28:11 UTC', '2016-01-08 14:28:11 UTC')
409 Conflict

are popping up somewhat randomly.

One way to possibly recreate:
1. create repo, 2. sync repo, 3. create content view, 4. add repo to view, 5. publish view 

also is seen during katello:reset         

possibly race conditions?

Comment 1 John Mitsch 2016-03-18 19:09:12 UTC
Created from redmine issue http://projects.theforeman.org/issues/13085

Comment 2 John Mitsch 2016-03-18 19:09:43 UTC
Note that this is a transient error and will not happen every time you publish a content view

Comment 5 John Mitsch 2016-03-30 16:09:48 UTC
PR open upstream https://github.com/Katello/katello/pull/5902

Comment 6 Bryan Kearney 2016-03-30 18:11:51 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/13085 has been closed
-------------
John Mitsch
Applied in changeset commit:katello|c92c13fa113533fc8cf255e9d12038a4069067ec.

Comment 7 jcallaha 2016-04-06 20:46:54 UTC
Verified in Satellite 6.2 Beta Snap 6 Compose 2.

No longer able to reproduce the issue with over 50 publishes and promotions.

Comment 9 errata-xmlrpc 2016-07-27 09:28:00 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/RHBA-2016:1501


Note You need to log in before you can comment on or make changes to this bug.