Foreman OS upgrade

Problem: Postgresql does not start after OS upgade from 7.9 to 8.6

Expected outcome:

Foreman and Proxy versions: 3.3 and 4.5 for katello

Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

Hello,

I’ve got those errors when try to start postgresql:

[root@dsdpsatellite] ~ # foreman-installer --disable-system-checks
2022-08-25 14:18:00 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-08-25 14:18:04 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-08-25 14:18:04 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-08-25 14:18:09 [WARN  ] [pre] Skipping system checks.
2022-08-25 14:18:09 [WARN  ] [pre] Skipping system checks.
2022-08-25 14:18:09 [NOTICE] [configure] Starting system configuration.
2022-08-25 14:18:24 [NOTICE] [configure] 250 configuration steps out of 1786 steps complete.
2022-08-25 14:18:29 [NOTICE] [configure] 500 configuration steps out of 1786 steps complete.
2022-08-25 14:18:32 [NOTICE] [configure] 750 configuration steps out of 1791 steps complete.
2022-08-25 14:18:32 [NOTICE] [configure] 1000 configuration steps out of 1797 steps complete.
2022-08-25 14:18:33 [ERROR ] [configure] Systemd start for postgresql failed!
2022-08-25 14:18:33 [ERROR ] [configure] journalctl log for postgresql:
2022-08-25 14:18:33 [ERROR ] [configure] -- Logs begin at Wed 2022-08-17 10:53:20 CEST, end at Thu 2022-08-25 14:18:33 CEST. --
2022-08-25 14:18:33 [ERROR ] [configure] Aug 25 14:18:33 dsdpsatellite systemd[1]: Starting PostgreSQL database server...
2022-08-25 14:18:33 [ERROR ] [configure] Aug 25 14:18:33 dsdpsatellite systemd[1]: postgresql.service: Control process exited, code=exited status=1
2022-08-25 14:18:33 [ERROR ] [configure] Aug 25 14:18:33 dsdpsatellite systemd[1]: postgresql.service: Failed with result 'exit-code'.
2022-08-25 14:18:33 [ERROR ] [configure] Aug 25 14:18:33 dsdpsatellite systemd[1]: Failed to start PostgreSQL database server.
2022-08-25 14:18:33 [ERROR ] [configure] /Stage[main]/Postgresql::Server::Service/Service[postgresqld]/ensure: change from 'stopped' to 'running' failed: Systemd start for postgresql failed!
2022-08-25 14:18:33 [ERROR ] [configure] journalctl log for postgresql:
2022-08-25 14:18:33 [ERROR ] [configure] -- Logs begin at Wed 2022-08-17 10:53:20 CEST, end at Thu 2022-08-25 14:18:33 CEST. --
2022-08-25 14:18:33 [ERROR ] [configure] Aug 25 14:18:33 dsdpsatellite systemd[1]: Starting PostgreSQL database server...
2022-08-25 14:18:33 [ERROR ] [configure] Aug 25 14:18:33 dsdpsatellite systemd[1]: postgresql.service: Control process exited, code=exited status=1
2022-08-25 14:18:33 [ERROR ] [configure] Aug 25 14:18:33 dsdpsatellite systemd[1]: postgresql.service: Failed with result 'exit-code'.
2022-08-25 14:18:33 [ERROR ] [configure] Aug 25 14:18:33 dsdpsatellite systemd[1]: Failed to start PostgreSQL database server.
2022-08-25 14:18:33 [NOTICE] [configure] 1250 configuration steps out of 1798 steps complete.
2022-08-25 14:18:39 [NOTICE] [configure] 1500 configuration steps out of 1798 steps complete.
2022-08-25 14:18:39 [NOTICE] [configure] 1750 configuration steps out of 1798 steps complete.
2022-08-25 14:18:42 [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
[root@dsdpsatellite] ~ # systemctl start postgresql.service
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xe" for details.
[root@dsdpsatellite] ~ # journalctl -xe
Aug 25 14:18:33 dsdpsatellite systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit postgresql.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit postgresql.service has failed.
--
-- The result is failed.
Aug 25 14:18:35 dsdpsatellite puppet-agent[1526]: Connection to https://dsdpsatellite.fmlogistic.fr:8140/puppet-ca/v1 failed, trying next route: Reques>
Aug 25 14:18:35 dsdpsatellite puppet-agent[1526]: Wrapped exception:
Aug 25 14:18:35 dsdpsatellite puppet-agent[1526]: Failed to open TCP connection to dsdpsatellite.fmlogistic.fr:8140 (Connection refused - connect(2) fo>
Aug 25 14:18:35 dsdpsatellite puppet-agent[1526]: No more routes to ca
Aug 25 14:18:39 dsdpsatellite crontab[22488]: (root) LIST (root)
Aug 25 14:19:01 dsdpsatellite systemd[1]: Starting PostgreSQL database server...
-- Subject: Unit postgresql.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit postgresql.service has begun starting up.
Aug 25 14:19:01 dsdpsatellite postgresql-check-db-dir[22498]: cat: /var/lib/pgsql/data/PG_VERSION: Permission denied
Aug 25 14:19:01 dsdpsatellite postgresql-check-db-dir[22497]: An old version '' of the database format was found.
Aug 25 14:19:01 dsdpsatellite postgresql-check-db-dir[22497]: You need to dump and reload before using PostgreSQL 12.11.
Aug 25 14:19:01 dsdpsatellite postgresql-check-db-dir[22497]: See /usr/share/doc/postgresql/README.rpm-dist for more information.
Aug 25 14:19:01 dsdpsatellite systemd[1]: postgresql.service: Control process exited, code=exited status=1
Aug 25 14:19:01 dsdpsatellite systemd[1]: postgresql.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit postgresql.service has entered the 'failed' state with result 'exit-code'.
Aug 25 14:19:01 dsdpsatellite systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit postgresql.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit postgresql.service has failed.
--
-- The result is failed.

I followed the procedure from foreman doc => Upgrading and Updating Foreman

Everything went done except when I tried the launch the last command (foreman-installer --disable-system-checks).
Can you help me to make the postgresql start please (I’m not DBA, so if you can explain you are welcome).

Thx a lot.

can you ensure all data is owned by postgres?

# chown -R postgres.postgres /var/lib/pgsql/data

This is something we recently fixed in Leapp (https://github.com/oamg/leapp-repository/pull/916) but didn’t publish a release for yet.

1 Like