Red Hat Satellite upgrade from version 6.7 to 6.8 fails with error touch /var/lib/candlepin/cpdb_update_done' returned 1 instead of one of [0]
Environment
- Red Hat Satellite 6.7
- Red Hat Satellite 6.8
Issue
- Satellite upgrade to version 6.8 fails during PostgreSQL migration step with error
touch /var/lib/candlepin/cpdb_update_done' returned 1 instead of one of [0]
Resolution
- Execute PostgreSQL migration manually by a simple execution of
satellite-installerand ensure it is successful.
For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.
Root Cause
- The
/var/opt/rh/rh-postgresql12/lib/pgsql/datadirectory pre exists on Satellite machine.
Diagnostic Steps
-
Below errors are observed in
/var/log/foreman-installer/satellite.log:[ERROR 2021-01-01T00:36:24 main] /Stage[main]/Candlepin::Database::Postgresql/Exec[cpdb update]/returns: change from 'notrun' to ['0'] failed: 'cpdb --update --dbhost=localhost --dbport=5432 --database='candlepin' --user='candlepin' --password='rndnZAT999R36zptNXwm'>> /var/log/candlepin/cpdb.log 2>&1 && touch /var/lib/candlepin/cpdb_update_done' returned 1 instead of one of [0] [ERROR 2021-01-01T00:36:24 main] /Stage[main]/Candlepin::Database::Postgresql/Exec[cpdb update]: Failed to call refresh: 'cpdb --update --dbhost=localhost --dbport=5432 --database='candlepin' --user='candlepin' --password='rndnZAT999R36zptNXwm' >> /var/log/candlepin/cpdb.log 2>&1 && touch /var/lib/candlepin/cpdb_update_done' returned 1 instead of one of [0] [ERROR 2021-01-01T00:36:24 main] /Stage[main]/Candlepin::Database::Postgresql/Exec[cpdb update]: 'cpdb --update --dbhost=localhost --dbport=5432 --database='candlepin' --user='candlepin' --password='rndnZAT999R36zptNXwm' >> /var/log/candlepin/cpdb.log 2>&1 && touch /var/lib/candlepin/cpdb_update_done' returned 1 instead of one of [0] -
Below errors are observed in
/var/log/candlepin/cpdb.log########## ERROR ############ Error running command: /usr/share/candlepin/liquibase.sh --driver=org.postgresql.Driver --classpath=/var/lib/tomcat/webapps/candlepin/WEB-INF/lib/postgresql-42.2.2.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-update.xml --url="jdbc:postgresql://localhost:5432/candlepin" --username=$DBUSERNAME --password=********$DBPASSWORD --logLevel=severe migrate -Dcommunity=False Status code: 65280 Command output: SEVERE 1/29/21 3:35 PM:liquibase: db/changelog/changelog-update.xml: db/changelog/20120416134048-insert-uebercert-consumer-type.xml::20120416134048::mstead: Change Set db/changelog/20120416134048-insert-uebercert-consumer-type.xml::20120416134048::mstead failed. Error: Error executing SQL INSERT INTO public.cp_consumer_type (id, label, manifest) VALUES ('1005', 'uebercert', 'N'): ERROR: relation "public.cp_consumer_type" does not exist Position: 13 liquibase.exception.DatabaseException: Error executing SQL INSERT INTO public.cp_consumer_type (id, label, manifest) VALUES ('1005', 'uebercert', 'N'): ERROR: relation "public.cp_consumer_type" does not exist
SBR
Product(s)
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.