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 1503177 - Liquibase migration fails when activation keys referencing missing products exist
Summary: Liquibase migration fails when activation keys referencing missing products e...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Candlepin
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Sachin Ghai
URL:
Whiteboard:
Depends On: 1503179
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-17 13:45 UTC by Barnaby Court
Modified: 2019-04-01 20:26 UTC (History)
11 users (show)

Fixed In Version: candlepin-2.1.7-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1503176
Environment:
Last Closed: 2018-02-21 17:02:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 1754 0 None closed Delete missing products from activation keys while upgrading. 2020-06-18 05:26:25 UTC

Description Barnaby Court 2017-10-17 13:45:09 UTC
+++ This bug was initially created as a clone of Bug #1503176 +++

Description of problem:

When migrating from 0.9.54 to 2.x, if a database has activation keys that are referencing products that have been deleted, the migration will fail.  The failure occurs in PerOrgsProductsMigrationTask due to the presence of the records in cp_activationkey_product that reference the missing products.

Version-Release number of selected component (if applicable): 2.x series

How reproducible: Always

Steps to Reproduce:
1. Starting with 0.9.54, create an activation key using a productId that does not exist.
2. Attempt to migrate to candlepin 2.0.

liquibase --driver=org.postgresql.Driver --classpath=/usr/share/java/postgresql-jdbc.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-update.xml --url=jdbc:postgresql:candlepin --username=candlepin  --password=<PASSWORD> migrate -Dcommunity=False

Actual results:

Liquibase update Failed: Migration failed for change set db/changelog/20150210094558-perorgproducts-phase-1.xml::20150210094558-35::crog:
     Reason: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: liquibase.exception.DatabaseException: One or more orgs failed data validation

Expected results:

Successful migration

Comment 2 Mike McCune 2017-10-17 13:50:00 UTC
This is an upgrade blocker from 6.2 -> 6.3

Comment 9 Sachin Ghai 2017-11-03 08:05:08 UTC
Verified w/ same db where issue was reproduced by upgrading the DB to 6.3 and migrate_candlepin step was completed successfully.

Comment 10 Bryan Kearney 2018-02-21 17:02:05 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-2018:0336


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