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.
'candlepin-validate-db' pre-upgrade check fails with "Could not open SSL root certificate file /root/.postgresql/root.crt" error for external DB setup with SSL
Description of problem:
satellite pre-upgrade check to validate candlepin db 'candlepin-validate-db' fails with "Could not open SSL root certificate file /root/.postgresql/root.crt" error for external DB setup with SSL
Version-Release number of selected component (if applicable):
Satellite 6.11.2 Snap 2.0 and Satellite 6.12.0 Snap 9.0
How reproducible:
Always
Steps to Reproduce:
1. # foreman-maintain upgrade check --target-version 6.12
OR
1. # foreman-maintain health check --label candlepin-validate-db
```
--------------------------------------------------------------------------------
Check to validate candlepin database: [FAIL]
########## ERROR ############
Error running command: /usr/share/candlepin/liquibase.sh --driver=org.postgresql.Driver --classpath=/var/lib/tomcat/webapps/candlepin/WEB-INF/lib/postgresql-42.3.3.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-validate.xml --url="jdbc:postgresql://satellite.example.com:5432/candlepin1db?ssl=true" --username=$DBUSERNAME --password=$DBPASSWORD --logLevel=debug migrate -Dcommunity=False
Status code: 255
Command output: Liquibase update Failed: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt.
SEVERE 9/6/22, 9:09 AM:liquibase: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt.
liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt.
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:61)
at liquibase.integration.commandline.Main.doMigration(Main.java:788)
at liquibase.integration.commandline.Main.main(Main.java:133)
Caused by: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt.
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:231)
at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:141)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:52)
... 2 more
Caused by: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt.
at org.postgresql.ssl.LibPQFactory.<init>(LibPQFactory.java:150)
at org.postgresql.core.SocketFactoryFactory.getSslSocketFactory(SocketFactoryFactory.java:61)
at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:34)
at org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:571)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:168)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223)
at org.postgresql.Driver.makeConnection(Driver.java:400)
at org.postgresql.Driver.connect(Driver.java:259)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:223)
... 4 more
Caused by: java.io.FileNotFoundException: /root/.postgresql/root.crt (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
at org.postgresql.ssl.LibPQFactory.<init>(LibPQFactory.java:147)
... 14 more
For more information, use the --logLevel flag
Configuring PostgreSQL with JDBC URL: jdbc:postgresql://satellite.example.com:5432/candlepin1db?ssl=true
Validating Candlepin database
--driver=org.postgresql.Driver --classpath=/var/lib/tomcat/webapps/candlepin/WEB-INF/lib/postgresql-42.3.3.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-validate.xml --url="jdbc:postgresql://satellite.example.com:5432/candlepin1db?ssl=true" --username=$DBUSERNAME --password=$DBPASSWORD --logLevel=debug
Traceback (most recent call last):
File "/usr/share/candlepin/cpdb", line 287, in <module>
dbsetup.validate()
File "/usr/share/candlepin/cpdb", line 75, in validate
self._run_liquibase("db/changelog/changelog-validate.xml")
File "/usr/share/candlepin/cpdb", line 114, in _run_liquibase
output = run_command("/usr/share/candlepin/liquibase.sh %s migrate -Dcommunity=%s" % (liquibase_options, self.community))
File "/usr/share/candlepin/cpdb", line 43, in run_command
error_out(command, status, output)
File "/usr/share/candlepin/cpdb", line 51, in error_out
raise Exception("Error running command")
Exception: Error running command
--------------------------------------------------------------------------------
```
Actual results:
Expected results:
Additional info:
Seems similar to BZ 2090820
Can you expand on how you installed your Satellite 6.11 with external database with SSL? To do so, you would have needed to run the installer with `--katello-candlepin-db-ssl-ca` which should then have avoided this issue.
Verified.
Tested on Satellite 6.12.0 Snap 12.0
Version: rubygem-foreman_maintain-1.1.6-1.el8sat.noarch
Steps:
1. Setup Satellite 6.11 with External DB with SSL along with 6.12 repos required for upgrade.
2. # foreman-maintain upgrade check --target-version 6.12
OR
2. # foreman-maintain health check --label candlepin-validate-db
Observation:
candlepin-validate-db check passes without any errors.
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 (Important: Satellite 6.12 Release), 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-2022:8506
Comment 10Red Hat Bugzilla
2023-09-19 04:25:56 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days
Description of problem: satellite pre-upgrade check to validate candlepin db 'candlepin-validate-db' fails with "Could not open SSL root certificate file /root/.postgresql/root.crt" error for external DB setup with SSL Version-Release number of selected component (if applicable): Satellite 6.11.2 Snap 2.0 and Satellite 6.12.0 Snap 9.0 How reproducible: Always Steps to Reproduce: 1. # foreman-maintain upgrade check --target-version 6.12 OR 1. # foreman-maintain health check --label candlepin-validate-db ``` -------------------------------------------------------------------------------- Check to validate candlepin database: [FAIL] ########## ERROR ############ Error running command: /usr/share/candlepin/liquibase.sh --driver=org.postgresql.Driver --classpath=/var/lib/tomcat/webapps/candlepin/WEB-INF/lib/postgresql-42.3.3.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-validate.xml --url="jdbc:postgresql://satellite.example.com:5432/candlepin1db?ssl=true" --username=$DBUSERNAME --password=$DBPASSWORD --logLevel=debug migrate -Dcommunity=False Status code: 255 Command output: Liquibase update Failed: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt. SEVERE 9/6/22, 9:09 AM:liquibase: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt. liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt. at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:61) at liquibase.integration.commandline.Main.doMigration(Main.java:788) at liquibase.integration.commandline.Main.main(Main.java:133) Caused by: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt. at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:231) at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:141) at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:52) ... 2 more Caused by: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt. at org.postgresql.ssl.LibPQFactory.<init>(LibPQFactory.java:150) at org.postgresql.core.SocketFactoryFactory.getSslSocketFactory(SocketFactoryFactory.java:61) at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:34) at org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:571) at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:168) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223) at org.postgresql.Driver.makeConnection(Driver.java:400) at org.postgresql.Driver.connect(Driver.java:259) at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:223) ... 4 more Caused by: java.io.FileNotFoundException: /root/.postgresql/root.crt (No such file or directory) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:219) at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157) at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112) at org.postgresql.ssl.LibPQFactory.<init>(LibPQFactory.java:147) ... 14 more For more information, use the --logLevel flag Configuring PostgreSQL with JDBC URL: jdbc:postgresql://satellite.example.com:5432/candlepin1db?ssl=true Validating Candlepin database --driver=org.postgresql.Driver --classpath=/var/lib/tomcat/webapps/candlepin/WEB-INF/lib/postgresql-42.3.3.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-validate.xml --url="jdbc:postgresql://satellite.example.com:5432/candlepin1db?ssl=true" --username=$DBUSERNAME --password=$DBPASSWORD --logLevel=debug Traceback (most recent call last): File "/usr/share/candlepin/cpdb", line 287, in <module> dbsetup.validate() File "/usr/share/candlepin/cpdb", line 75, in validate self._run_liquibase("db/changelog/changelog-validate.xml") File "/usr/share/candlepin/cpdb", line 114, in _run_liquibase output = run_command("/usr/share/candlepin/liquibase.sh %s migrate -Dcommunity=%s" % (liquibase_options, self.community)) File "/usr/share/candlepin/cpdb", line 43, in run_command error_out(command, status, output) File "/usr/share/candlepin/cpdb", line 51, in error_out raise Exception("Error running command") Exception: Error running command -------------------------------------------------------------------------------- ``` Actual results: Expected results: Additional info: Seems similar to BZ 2090820