After upgrade Foreman from 2.5 to 3.0 version

hi all,

after upgrade foreman from version 2.5 to 3.0, I see two directories in /etc/postgresql 10 and 12 directory and I get below error for postgresql:

root@myserver:~# systemctl status postgresql@12-main
ā— postgresql@12-main.service - PostgreSQL Cluster 12-main
     Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor preset: enabled)
     Active: failed (Result: protocol) since Wed 2022-08-03 10:42:13 CEST; 52min ago
    Process: 5954 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 12-main start (code=exited, status=1/FAILURE)

Aug 03 10:42:13 myserver postgresql@12-main[5954]: 2022-08-03 10:42:13 CEST LOG:  could not bind IPv4 address "127.0.0.1": Address already in use
Aug 03 10:42:13 myserver postgresql@12-main[5954]: 2022-08-03 10:42:13 CEST HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
Aug 03 10:42:13 myserver postgresql@12-main[5954]: 2022-08-03 10:42:13 CEST WARNING:  could not create listen socket for "localhost"
Aug 03 10:42:13 myserver postgresql@12-main[5954]: 2022-08-03 10:42:13 CEST FATAL:  could not create any TCP/IP sockets
Aug 03 10:42:13 myserver postgresql@12-main[5954]: 2022-08-03 10:42:13 CEST LOG:  database system is shut down
Aug 03 10:42:13 myserver postgresql@12-main[5954]: pg_ctl: could not start server
Aug 03 10:42:13 myserver postgresql@12-main[5954]: Examine the log output.
Aug 03 10:42:13 myserver systemd[1]: postgresql@12-main.service: Can't open PID file /run/postgresql/12-main.pid (yet?) after start: Operation not permitted
Aug 03 10:42:13 myserver systemd[1]: postgresql@12-main.service: Failed with result 'protocol'.
Aug 03 10:42:13 myserver systemd[1]: Failed to start PostgreSQL Cluster 12-main.

Do I have stop postgresql version 10 and start the 12 ?

thanks in advance

I upgrade the foreman like below:

https://theforeman.org/manuals/3.0/index.html#3.6Upgradeto3.0

After point Optional Step 3 (C) - Run foreman-installer:

To apply these changes, run the installer again without options

foreman-installer

When I run foreman-installer my hosts are deleted and I have no puppet_classes anymore, does anyone know why ?

Im still on Test-System.

If you tweaked the db configuration file, the installer will reset those changes. Also given you had some issues with the DB migration, are you sure the data has been migrated correctly?

1 Like

@Marek_Hulan thanks for your answer, it works now correctly , it was my fault I skipped one step from the upgrade step. (Test-System) so I did it again and it works. thanks again

1 Like