Foreman 3.10 -> 3.11 upgrade / systemd start for postgresql failed! database was installed on a thirst node

Problem:
When running the pre script prior to upgrade

Expected outcome:

Foreman and Proxy versions:
3.10
Foreman and Proxy plugin versions:

Distribution and version:
RHEL 8.10
Other relevant data:

Postgresql database is installed on on third node.

How to proceed please ?

Regards

Remote database was upgraded to version 13 but still have this error :

[QLF:root@for01s:~]# foreman-installer --foreman-proxy-dns-managed=false --foreman-proxy-dhcp-managed=false
2024-07-05 13:13:10 [NOTICE] [root] Loading installer configuration. This will take some time.
2024-07-05 13:13:13 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2024-07-05 13:13:13 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2024-07-05 13:13:16 [NOTICE] [configure] Starting system configuration.
2024-07-05 13:13:33 [NOTICE] [configure] 250 configuration steps out of 1335 steps complete.
2024-07-05 13:13:33 [NOTICE] [configure] 500 configuration steps out of 1337 steps complete.
2024-07-05 13:13:33 [NOTICE] [configure] 750 configuration steps out of 1344 steps complete.
2024-07-05 13:13:34 [NOTICE] [configure] 1000 configuration steps out of 1350 steps complete.
2024-07-05 13:13:34 [NOTICE] [configure] 1250 configuration steps out of 1381 steps complete.
2024-07-05 13:13:34 [ERROR ] [configure] Systemd start for postgresql failed!
2024-07-05 13:13:34 [ERROR ] [configure] journalctl log for postgresql:
2024-07-05 13:13:34 [ERROR ] [configure] ā€“ Logs begin at Mon 2024-07-01 20:05:26 CEST, end at Fri 2024-07-05 13:13:34 CEST. ā€“
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s systemd[1]: Starting PostgreSQL database serverā€¦
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s postgresql-check-db-dir[554921]: An old version of the database format was found.
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s postgresql-check-db-dir[554921]: Use ā€˜postgresql-setup --upgradeā€™ to upgrade to version ā€˜13ā€™
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s postgresql-check-db-dir[554921]: See /usr/share/doc/postgresql/README.rpm-dist for more information.
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s systemd[1]: postgresql.service: Control process exited, code=exited status=1
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s systemd[1]: postgresql.service: Failed with result ā€˜exit-codeā€™.
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s systemd[1]: Failed to start PostgreSQL database server.
2024-07-05 13:13:34 [ERROR ] [configure] /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Service[postgresqld_instance_main]/ensure: change from ā€˜stoppedā€™ to ā€˜runningā€™ failed: Systemd start for postgresql failed!
2024-07-05 13:13:34 [ERROR ] [configure] journalctl log for postgresql:
2024-07-05 13:13:34 [ERROR ] [configure] ā€“ Logs begin at Mon 2024-07-01 20:05:26 CEST, end at Fri 2024-07-05 13:13:34 CEST. ā€“
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s systemd[1]: Starting PostgreSQL database serverā€¦
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s postgresql-check-db-dir[554921]: An old version of the database format was found.
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s postgresql-check-db-dir[554921]: Use ā€˜postgresql-setup --upgradeā€™ to upgrade to version ā€˜13ā€™
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s postgresql-check-db-dir[554921]: See /usr/share/doc/postgresql/README.rpm-dist for more information.
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s systemd[1]: postgresql.service: Control process exited, code=exited status=1
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s systemd[1]: postgresql.service: Failed with result ā€˜exit-codeā€™.
2024-07-05 13:13:34 [ERROR ] [configure] Jul 05 13:13:34 oqfor01s systemd[1]: Failed to start PostgreSQL database server.
2024-07-05 13:13:44 [NOTICE] [configure] System configuration has finished.

Error 1: Puppet Service resource ā€˜postgresqld_instance_mainā€™ failed. Logs:
/Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Service[postgresqld_instance_main]/notify
notify to Service[dynflow-sidekiq@orchestrator]
notify to Service[dynflow-sidekiq@worker-1]
/Service[postgresqld_instance_main]
Starting to evaluate the resource (1284 of 1381)
Evaluated in 0.42 seconds
/Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Service[postgresqld_instance_main]/ensure
change from ā€˜stoppedā€™ to ā€˜runningā€™ failed: Systemd start for postgresql failed!

Here is the database.xml file :

more database.yml


File managed with puppet

Module: ā€˜ā€™

Database is managed by foreman::database::postgresql

production:
adapter: postgresql
host: foreman-acc-pgsql.blabla.net
database: foreman
username: foreman
password: ā€œxxxxxxxxxxā€
pool: 5

It suggests to me that, besides using a remote DB, it also uses a local DB. Can you share how you installed Foreman?

Honesty itā€™s too old to print here all the option I used. But I use a remote database.

I tried to update then the local DB to ā€œfoolā€ the install procedure but now got this error :
]# postgresql-setup --upgrade
ERROR: data_directory field in configuration file is not supported.
db datadir (PGDATA) needs to be specified exclusively in service/unit
file as an Environment variable.
In order to use this script, please remove data_directory entry from
configuration file and make sure that the default location
(PGDATA) in .service file is valid.

jfwi,

I had exactly the same problem. See my solution here:

Regards,

-jm

1 Like