Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1493838

Summary: upgrade: pulp dup key error prevents upgrade to Sat 6.3 from Sat 6.2.11 in table units_yum_repo_metadata_file
Product: Red Hat Satellite Reporter: Billy Holmes <biholmes>
Component: Satellite CloneAssignee: John Mitsch <jomitsch>
Status: CLOSED ERRATA QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.11CC: bbuckingham, biholmes, bkearney, ehelms, inecas, jomitsch, mbacovsk, mhrivnak, mmccune, ttereshc
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-04 17:54:03 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:

Description Billy Holmes 2017-09-21 02:37:36 UTC
Description of problem:

Tried to upgrade to Satellite 6.3 from Satellite 6.2.11.

pulp database upgrade task fails with:

E11000 duplicate key error index: pulp_database.units_yum_repo_metadata_file.$data_type_1_repo_id_1  dup key: { : "productid", : "Demo62-Dev-Combined-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Extras_RPMs_x86_64" }

Running a query on the pulp_database, I found these duplicate entries:

      2 productid;Demo62-Dev-Combined-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Extras_RPMs_x86_64
      2 productid;Demo62-Dev-Small-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Extras_RPMs_x86_64
      3 productid;Demo62-Library-Combined-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Extras_RPMs_x86_64
      5 productid;Demo62-Library-Small-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Extras_RPMs_x86_64
      2 productid;Demo62-QA-Small-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_-_Extras_RPMs_x86_64

This aligns with my current Content View publish/promote configuration/history:

* 2 Promotions of LE:Dev from CV:Combined
* 2 Promotions of LE:Dev from Small
* 3 versions of CV:Combined
* 5 versions of CV:Small
* 2 Promotions of LE:QA from CV:Small

Version-Release number of selected component (if applicable):

Satellite 6.2.11

How reproducible:


Steps to Reproduce:
1. Create a CV
2. Publish at least 2 versions of it
3. Promote at least 1 environment of it (other than Library)

Actual results:

satellite-installer has a fatal error due to pulp migration task attempting to overlay a unique key on the pulp database.

Expected results:

satellite-installer does not error after pulp migration adds the unique key to the pulp database.

Additional info:

Comment 1 Ivan Necas 2017-09-21 10:30:26 UTC
Thanks Billy, please provide sosreport from the failure for further analysis

Comment 3 Michael Hrivnak 2017-09-25 13:06:55 UTC
Billy, could you provide the full output from pulp-manage-db?

Also there should be a traceback either on the console or in the system log related to this. That would be very helpful to see as well.

Comment 14 John Mitsch 2017-11-07 20:15:15 UTC
Thanks Tanya,

Sorry about the delay in getting to this BZ

regarding why we drop the collections: if you try to publish a repository (such as when publishing a cv), if there's a distribution in the repo that isn't actually on the filesystem, pulp will error.

I added a pulp-manage-db step to the reset pulp data steps:
https://github.com/RedHatSatellite/satellite-clone/pull/256

Thanks again for looking into this!

Comment 15 Brad Buckingham 2017-11-14 13:25:22 UTC
Moving to POST, since satellite-clone PR has been merged.

Comment 16 John Mitsch 2017-12-18 14:46:47 UTC
This should be present in 1.2.0

Comment 17 Mike McCune 2017-12-18 16:19:31 UTC
Verified that pulp-manage-db is now called during clone in 1.2:

2017-12-15 12:09:11,035 p=19443 u=root |  TASK [satellite-clone : migrate pulp db] ******************************************************************************

... 

journal verifying sudo call:

Dec 15 12:09:11 ibm-x3250m4-05.lab.eng.rdu2.redhat.com sudo[26588]:     root : TTY=pts/0 ; PWD=/usr/share/satellite-clone ; USER=apache ; COMMAND=/bin/pulp-manage-db

Comment 20 errata-xmlrpc 2018-01-04 17:54:03 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-2018:0033