Bug 1493838 - upgrade: pulp dup key error prevents upgrade to Sat 6.3 from Sat 6.2.11 in table units_yum_repo_metadata_file
Summary: upgrade: pulp dup key error prevents upgrade to Sat 6.3 from Sat 6.2.11 in ta...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Clone
Version: 6.2.11
Hardware: x86_64
OS: Linux
unspecified
high vote
Target Milestone: Unspecified
Assignee: John Mitsch
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-21 02:37 UTC by Billy Holmes
Modified: 2019-08-12 14:07 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-04 17:54:03 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0033 0 normal SHIPPED_LIVE Satellite Maintenance bug fix update 2018-01-04 22:53:47 UTC

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


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