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.
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
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.
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