Bug 2062189

Summary: satellite-installer gets failed with "Could not open SSL root certificate file /root/.postgresql/root.crt" error.
Product: Red Hat Satellite Reporter: Devendra Singh <desingh>
Component: InstallationAssignee: Evgeni Golov <egolov>
Status: CLOSED ERRATA QA Contact: Devendra Singh <desingh>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: ahumbe, egolov, ehelms, gtalreja, mdolezel, pcreech
Target Milestone: 6.11.0Keywords: AutomationBlocker, Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: foreman-installer-3.1.2.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:34:21 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:

Description Devendra Singh 2022-03-09 11:01:07 UTC
Description of problem: satellite-installer gets failed with "Could not open SSL root certificate file /root/.postgresql/root.crt" 


Version-Release number of selected component (if applicable):
7.0 Snap12

How reproducible:
always

Steps to Reproduce:
1. Install the unconfigured(only packages) satellite
2. Generate the SSL certificate.
3. Install the external Postgresql database and update all the required configurations for SSL. 
4. Run the installer on the satellite to integrate the external database but the command gets failed with following error 

satellite-installer --scenario satellite --foreman-initial-admin-password **** --foreman-db-manage false --foreman-db-host postgres.com --foreman-db-database foreman1db --foreman-db-username foreman1!  --foreman-db-password ****  --foreman-db-port 5432 --katello-candlepin-manage-db false --katello-candlepin-db-host postgres.com --katello-candlepin-db-name candlepin1db --katello-candlepin-db-user candlepin1!  --katello-candlepin-db-password ****  --katello-candlepin-db-port 5432 --foreman-proxy-content-pulpcore-manage-postgresql false --foreman-proxy-content-pulpcore-postgresql-host postgres.com --foreman-proxy-content-pulpcore-postgresql-db-name pulpcore1db --foreman-proxy-content-pulpcore-postgresql-user pulp1!  --foreman-proxy-content-pulpcore-postgresql-password ****  --foreman-proxy-content-pulpcore-postgresql-port 5432 --foreman-db-sslmode verify-full --foreman-db-root-cert /usr/share/foreman/root.crt --katello-candlepin-db-ssl true --katello-candlepin-db-ssl-verify true --foreman-proxy-content-pulpcore-postgresql-ssl true

2022-03-09 04:26:29 [NOTICE] [configure] 500 configuration steps out of 1443 steps complete.
2022-03-09 04:26:34 [ERROR ] [configure] Execution of '/usr/share/candlepin/cpdb --create --schema-only --dbhost=postgres.com --dbport=5432 --database=candlepin1db?ssl=true --user=candlepin1! --password=****' returned 1: ########## ERROR ############
2022-03-09 04:26:34 [ERROR ] [configure] Error running command: /usr/share/candlepin/liquibase.sh --driver=org.postgresql.Driver --classpath=/var/lib/tomcat/webapps/candlepin/WEB-INF/lib/postgresql-42.3.2.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-create.xml --url="jdbc:postgresql://postgres.com:5432/candlepin1db?ssl=true" --username=$DBUSERNAME --password=$DBPASSWORD --logLevel=severe migrate -Dcommunity=False
2022-03-09 04:26:34 [ERROR ] [configure] Status code: 65280
2022-03-09 04:26:34 [ERROR ] [configure] Command output: Liquibase update Failed: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt.
2022-03-09 04:26:34 [ERROR ] [configure] SEVERE 3/9/22, 4:26 AM:liquibase: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: Could not open SSL root certificate file /root/.postgresql/root.crt.


Actual results:
Installer gets failed with "Could not open SSL root certificate file /root/.postgresql/root.crt" file error.

Expected results:
Installer should be completed successfully.

Additional info: Didn't see this problem with 7.0 snap11, 6.10.3 Snap2

Comment 6 Evgeni Golov 2022-03-24 09:21:54 UTC
Created redmine issue https://projects.theforeman.org/issues/34672 from this bug

Comment 7 Bryan Kearney 2022-03-24 12:05:15 UTC
Upstream bug assigned to egolov

Comment 8 Bryan Kearney 2022-03-24 12:05:18 UTC
Upstream bug assigned to egolov

Comment 9 Bryan Kearney 2022-03-25 16:05:14 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34672 has been resolved.

Comment 13 Evgeni Golov 2022-04-28 07:27:52 UTC
Huh, forgot to expose that in the installer, sorry!

https://github.com/theforeman/puppet-katello/pull/448 fixes it.

Comment 14 Evgeni Golov 2022-04-28 13:16:27 UTC
this was merged, needs to be picked again

Comment 17 Devendra Singh 2022-05-09 09:52:40 UTC
Verified on 6.11 Snap19 and it worked well.

satellite-installer --scenario satellite --foreman-initial-admin-password ***** --foreman-db-manage false --foreman-db-host  XYZ.com --foreman-db-database foreman1db --foreman-db-username foreman1! --foreman-db-password **** --foreman-db-port 5432 --katello-candlepin-manage-db false --katello-candlepin-db-host  XYZ.com --katello-candlepin-db-name     candlepin1db --katello-candlepin-db-user     candlepin1! --katello-candlepin-db-password ***** --katello-candlepin-db-port 5432 --foreman-proxy-content-pulpcore-manage-postgresql false  --foreman-proxy-content-pulpcore-postgresql-host ABC.com --foreman-proxy-content-pulpcore-postgresql-db-name pulpcore1db  --foreman-proxy-content-pulpcore-postgresql-user pulp1! --foreman-proxy-content-pulpcore-postgresql-password  ****  --foreman-proxy-content-pulpcore-postgresql-port 5432 --foreman-db-sslmode verify-full --foreman-db-root-cert /usr/share/foreman/root.crt --katello-candlepin-db-ssl true --katello-candlepin-db-ssl-verify true --foreman-proxy-content-pulpcore-postgresql-ssl true --katello-candlepin-db-ssl-ca /usr/share/foreman/root.crt
........
........
[34m2022-05-09 05:09:30[0m [[32mNOTICE[0m] [[36mroot[0m] Loading installer configuration. This will take some time.
[34m2022-05-09 05:09:36[0m [[32mNOTICE[0m] [[36mroot[0m] Running installer with log based terminal output at level NOTICE.
[34m2022-05-09 05:09:36[0m [[32mNOTICE[0m] [[36mroot[0m] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
[34m2022-05-09 05:12:47[0m [[32mNOTICE[0m] [[36mconfigure[0m] Starting system configuration.
[34m2022-05-09 05:12:59[0m [[32mNOTICE[0m] [[36mconfigure[0m] 250 configuration steps out of 1441 steps complete.
[34m2022-05-09 05:14:01[0m [[32mNOTICE[0m] [[36mconfigure[0m] 500 configuration steps out of 1443 steps complete.
[34m2022-05-09 05:14:31[0m [[32mNOTICE[0m] [[36mconfigure[0m] 750 configuration steps out of 1444 steps complete.
[34m2022-05-09 05:17:27[0m [[32mNOTICE[0m] [[36mconfigure[0m] 1000 configuration steps out of 1464 steps complete.
[34m2022-05-09 05:26:11[0m [[32mNOTICE[0m] [[36mconfigure[0m] 1250 configuration steps out of 1464 steps complete.
[34m2022-05-09 05:33:35[0m [[32mNOTICE[0m] [[36mconfigure[0m] System configuration has finished.
  [1m[32mSuccess![0m
  * [1m[36mSatellite[0m is running at [1m[36mhttps://XYZ.com[0m
      Initial credentials are [1m[36madmin[0m / [1m[36m*****[0m

  * To install an additional Capsule on separate machine continue by running:

      capsule-certs-generate --foreman-proxy-fqdn &quot;[1m[36m$CAPSULE[0m&quot; --certs-tar &quot;[1m[36m/root/$CAPSULE-certs.tar[0m&quot;
  * [1m[36mCapsule[0m is running at [1m[36mhttps://XYZ.com:9090[0m

  The full log is at [1m[36m/var/log/foreman-installer/satellite.log[0m
[1m[36mPackage versions are being locked.[0m

Comment 18 Evgeni Golov 2022-05-12 10:55:38 UTC
I've raised an upstream PR to document this: https://github.com/theforeman/foreman-documentation/pull/1270

@mdolezel what's the right way to get this into 6.11 docs?

Comment 25 errata-xmlrpc 2022-07-05 14:34:21 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 (Moderate: Satellite 6.11 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:5498

Comment 26 Red Hat Bugzilla 2023-09-15 01:52:34 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days