Bug 1556819
| Summary: | foreman-maintain upgrade check should check whether the entry for label=share is present in "cp_consumer_type" table | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Ashish Humbe <ahumbe> |
| Component: | Candlepin | Assignee: | Barnaby Court <bcourt> |
| Status: | CLOSED DUPLICATE | QA Contact: | Katello QA List <katello-qa-list> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.3.0 | CC: | apatel, gapatil, inecas, kgaikwad, khowell, mstead, nkathole |
| Target Milestone: | Unspecified | ||
| 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-06-11 14:15:20 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: | |||
Hello Michael, As per description, upgrade process failed on candlepin db migration with message "ERROR: duplicate key value violates unique constraint cp_consumer_type_label_key". IMHO, fix for the this issue is expected in candlepin. Please confirm. I have confirmed this from Micheal that this issue is related to Candlepin and fix should be expected there so moving this under Candlepin component. *** This bug has been marked as a duplicate of bug 1554371 *** |
Description of problem: - foreman-maintain should add a check for the below entry in the candlepin database. # select * from cp_consumer_type where label='share'; id | created | updated | label | manifest ----------------------------------+-------------------------------+-------------------------------+-------+---------- 8ac1507661e196ff0161ffd7abda2ccb | 2018-03-07 15:12:59.802+05:30 | 2018-03-07 15:12:59.802+05:30 | share | N (1 row) This entry is not present on all satellite v 6.2 servers, I have one Sat6.2 with this entry and another without above entry in the database. If this entry is present then the satellite upgrade fails at migrate_candlepin step, here is the error message: [DEBUG 2018-03-14 03:50:31 main] ########## ERROR ############ [DEBUG 2018-03-14 03:50:31 main] Error running command: 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=+FILTERED+ --logLevel=severe migrate -Dcommunity=False [DEBUG 2018-03-14 03:50:31 main] Status code: 65280 [DEBUG 2018-03-14 03:50:31 main] Command output: SEVERE 3/14/18 3:50 AM:liquibase: db/changelog/changelog-update.xml: db/changelog/20170206133825-add-share-consumer-type.xml::20170206133825-1::awood: Change Set db/changelog/20170206133825-add-share-consumer-type.xml::20170206133825-1::awood failed. Error: Error executing SQL INSERT INTO public.cp_consumer_type (id, label, manifest) VALUES ('1008', 'share', 'N'): ERROR: duplicate key value violates unique constraint "cp_consumer_type_label_key" [DEBUG 2018-03-14 03:50:31 main] Detail: Key (label)=(share) already exists. [DEBUG 2018-03-14 03:50:31 main] liquibase.exception.DatabaseException: Error executing SQL INSERT INTO public.cp_consumer_type (id, label, manifest) VALUES ('1008', 'share', 'N'): ERROR: duplicate key value violates unique constraint "cp_consumer_type_label_key" Version-Release number of selected component (if applicable): Satellite v 6.3 Steps to Reproduce: 1. Upgrade satellite v 6.2 to 6.3 (its reproducible only when we have the entry present in the database table before upgrade) 2. 3. Actual results: - Upgrade fails with error mentioned above. Expected results: - If the entry is already present in the candlepin database then foreman-maintain upgrade check should remove it or ask an admin to remove it by pointing out the KCS / required steps. Additional info: Here are the steps to fix this issue: # mkdir /candlepin-bkp # chmod 777 /candlepin-bkp # runuser - postgres -c "pg_dump -Fc candlepin > /candlepin-bkp/candlepin.dump" # su - postgres $ psql candlepin candlepin=# delete from cp_consumer_type where label='share'; candlepin=# \q bash-4.2$ exit # foreman-maintain upgrade run --target-version 6.3 For more details you can refer below KCS article: https://access.redhat.com/solutions/3380851