Install error: Command output: Liquibase update Failed: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: The connection attempt failed

Problem:
While using the below installer command I get the below error.

foreman-installer --scenario "katello" --foreman-initial-organization "TestOrg" --foreman-initial-location "Test" --foreman-initial-admin-username admin --foreman-initial-admin-password password --foreman-proxy-tftp=true --foreman-proxy-tftp-servername="192.168.31.223" --foreman-proxy-dhcp=true --foreman-proxy-dhcp-interface=ens192 --foreman-proxy-dhcp-range="192.168.31.20 192.168.31.200" --foreman-proxy-dns "true" --foreman-proxy-tftp "true" --enable-foreman-plugin-ansible --enable-foreman-plugin-remote-execution --enable-foreman-plugin-discovery --enable-foreman-compute-vmware --enable-foreman-proxy-plugin-ansible --enable-foreman-proxy-plugin-discovery --enable-foreman-proxy-plugin-remote-execution-ssh --foreman-proxy-realm=true --foreman-proxy-realm-principal="realm-proxy@LINUXLAB.LOCAL" --foreman-proxy-realm-keytab="/etc/foreman-proxy/freeipa.keytab" --foreman-proxy-realm-listen-on=https

2022-06-28 16:00:51 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-06-28 16:00:55 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-06-28 16:00:55 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-06-28 16:00:58 [NOTICE] [configure] Starting system configuration.
2022-06-28 16:01:08 [NOTICE] [configure] 250 configuration steps out of 1923 steps complete.
2022-06-28 16:01:08 [NOTICE] [configure] 500 configuration steps out of 1923 steps complete.
2022-06-28 16:01:10 [NOTICE] [configure] 750 configuration steps out of 1925 steps complete.
2022-06-28 16:01:13 [NOTICE] [configure] 1000 configuration steps out of 1933 steps complete.
2022-06-28 16:01:16 [NOTICE] [configure] 1250 configuration steps out of 1940 steps complete.
2022-06-28 16:01:17 [NOTICE] [configure] 1500 configuration steps out of 1940 steps complete.
2022-06-28 16:01:19 [ERROR ] [configure] Execution of '/usr/share/candlepin/cpdb --create --schema-only --dbhost=localhost --dbport=5432 --database=candlepin --user=candlepin --password=KxAK8j3Ft2yhUa5RKpQt73YNvUPtUhnQ' returned 1: ########## ERROR ############
2022-06-28 16:01:19 [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.2.2.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-create.xml --url="jdbc:postgresql://localhost:5432/candlepin" --username=$DBUSERNAME --password=$DBPASSWORD --logLevel=severe migrate -Dcommunity=False
2022-06-28 16:01:19 [ERROR ] [configure] Status code: 255
2022-06-28 16:01:19 [ERROR ] [configure] Command output: Liquibase update Failed: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] SEVERE 6/28/22, 4:01 PM:liquibase: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:61)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.integration.commandline.Main.doMigration(Main.java:788)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.integration.commandline.Main.main(Main.java:133)
2022-06-28 16:01:19 [ERROR ] [configure] Caused by: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:231)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:141)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:52)
2022-06-28 16:01:19 [ERROR ] [configure] ... 2 more
2022-06-28 16:01:19 [ERROR ] [configure] Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:257)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.Driver.makeConnection(Driver.java:452)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.Driver.connect(Driver.java:254)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:223)
2022-06-28 16:01:19 [ERROR ] [configure] ... 4 more
2022-06-28 16:01:19 [ERROR ] [configure] Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.Socket.connect(Socket.java:609)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.core.PGStream.<init>(PGStream.java:69)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:156)
2022-06-28 16:01:19 [ERROR ] [configure] ... 9 more
2022-06-28 16:01:19 [ERROR ] [configure]
2022-06-28 16:01:19 [ERROR ] [configure]
2022-06-28 16:01:19 [ERROR ] [configure] For more information, use the --logLevel flag
2022-06-28 16:01:19 [ERROR ] [configure] Configuring PostgreSQL with JDBC URL: jdbc:postgresql://localhost:5432/candlepin
2022-06-28 16:01:19 [ERROR ] [configure] Loading Candlepin schema
2022-06-28 16:01:19 [ERROR ] [configure] --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-create.xml --url="jdbc:postgresql://localhost:5432/candlepin" --username=$DBUSERNAME --password=$DBPASSWORD --logLevel=severe
2022-06-28 16:01:19 [ERROR ] [configure] Traceback (most recent call last):
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 284, in <module>
2022-06-28 16:01:19 [ERROR ] [configure] dbsetup.initialize_schema()
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 67, in initialize_schema
2022-06-28 16:01:19 [ERROR ] [configure] self._run_liquibase("db/changelog/changelog-create.xml")
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 114, in _run_liquibase
2022-06-28 16:01:19 [ERROR ] [configure] output = run_command("/usr/share/candlepin/liquibase.sh %s migrate -Dcommunity=%s" % (liquibase_options, self.community))
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 43, in run_command
2022-06-28 16:01:19 [ERROR ] [configure] error_out(command, status, output)
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 51, in error_out
2022-06-28 16:01:19 [ERROR ] [configure] raise Exception("Error running command")
2022-06-28 16:01:19 [ERROR ] [configure] Exception: Error running command
2022-06-28 16:01:19 [ERROR ] [configure] /Stage[main]/Candlepin::Database::Postgresql/Cpdb_create[candlepin]/ensure: change from 'absent' to 'present' failed: Execution of '/usr/share/candlepin/cpdb --create --schema-only --dbhost=localhost --dbport=5432 --database=candlepin --user=candlepin --password=KxAK8j3Ft2yhUa5RKpQt73YNvUPtUhnQ' returned 1: ########## ERROR ############
2022-06-28 16:01:19 [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.2.2.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-create.xml --url="jdbc:postgresql://localhost:5432/candlepin" --username=$DBUSERNAME --password=$DBPASSWORD --logLevel=severe migrate -Dcommunity=False
2022-06-28 16:01:19 [ERROR ] [configure] Status code: 255
2022-06-28 16:01:19 [ERROR ] [configure] Command output: Liquibase update Failed: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] SEVERE 6/28/22, 4:01 PM:liquibase: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:61)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.integration.commandline.Main.doMigration(Main.java:788)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.integration.commandline.Main.main(Main.java:133)
2022-06-28 16:01:19 [ERROR ] [configure] Caused by: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:231)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:141)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:52)
2022-06-28 16:01:19 [ERROR ] [configure] ... 2 more
2022-06-28 16:01:19 [ERROR ] [configure] Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:257)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.Driver.makeConnection(Driver.java:452)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.Driver.connect(Driver.java:254)
2022-06-28 16:01:19 [ERROR ] [configure] at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:223)
2022-06-28 16:01:19 [ERROR ] [configure] ... 4 more
2022-06-28 16:01:19 [ERROR ] [configure] Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
2022-06-28 16:01:19 [ERROR ] [configure] at java.base/java.net.Socket.connect(Socket.java:609)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.core.PGStream.<init>(PGStream.java:69)
2022-06-28 16:01:19 [ERROR ] [configure] at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:156)
2022-06-28 16:01:19 [ERROR ] [configure] ... 9 more
2022-06-28 16:01:19 [ERROR ] [configure]
2022-06-28 16:01:19 [ERROR ] [configure]
2022-06-28 16:01:19 [ERROR ] [configure] For more information, use the --logLevel flag
2022-06-28 16:01:19 [ERROR ] [configure] Configuring PostgreSQL with JDBC URL: jdbc:postgresql://localhost:5432/candlepin
2022-06-28 16:01:19 [ERROR ] [configure] Loading Candlepin schema
2022-06-28 16:01:19 [ERROR ] [configure] --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-create.xml --url="jdbc:postgresql://localhost:5432/candlepin" --username=$DBUSERNAME --password=$DBPASSWORD --logLevel=severe
2022-06-28 16:01:19 [ERROR ] [configure] Traceback (most recent call last):
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 284, in <module>
2022-06-28 16:01:19 [ERROR ] [configure] dbsetup.initialize_schema()
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 67, in initialize_schema
2022-06-28 16:01:19 [ERROR ] [configure] self._run_liquibase("db/changelog/changelog-create.xml")
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 114, in _run_liquibase
2022-06-28 16:01:19 [ERROR ] [configure] output = run_command("/usr/share/candlepin/liquibase.sh %s migrate -Dcommunity=%s" % (liquibase_options, self.community))
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 43, in run_command
2022-06-28 16:01:19 [ERROR ] [configure] error_out(command, status, output)
2022-06-28 16:01:19 [ERROR ] [configure] File "/usr/share/candlepin/cpdb", line 51, in error_out
2022-06-28 16:01:19 [ERROR ] [configure] raise Exception("Error running command")
2022-06-28 16:01:19 [ERROR ] [configure] Exception: Error running command
2022-06-28 16:01:27 [NOTICE] [configure] 1750 configuration steps out of 1940 steps complete.
2022-06-28 16:02:23 [NOTICE] [configure] System configuration has finished.

  There were errors detected during install.
  Please address the errors and re-run the installer to ensure the system is properly configured.
  Failing to do so is likely to result in broken functionality.

  The full log is at /var/log/foreman-installer/katello.log

Expected outcome:
Installer works

Foreman and Proxy versions:
Foreman 3.1 Server with Katello 4.3

Foreman and Proxy plugin versions:

Distribution and version:
Rocky 8.6

Other relevant data:
There is no /var/log/candlepin/cpdb.log file