Unable to upgrade gitlab-ce from 16.11.1 to 17.1.1 because of Postgresql

Hello,

I have upgrade Gitlab without an issue from now but recently I encounter a problem where I cannot seems to resolve. It seems that at one point when I upgrade postgresql think it upgrade to the last version 14.11 but when I check the log it say 13.14

In the log and in the dashboard

2024-07-08_14:51:40.70787 LOG:  starting PostgreSQL 13.14 on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit

image

but when I try to upgrade with

/opt/gitlab# gitlab-ctl pg-upgrade
Checking for an omnibus managed postgresql: OK
Checking if postgresql['version'] is set: OK
Checking if we already upgraded: OK
The latest version 14.11 is already running, nothing to do

And I cannot upgrade to the last on 17.1.1 or the last 16.11.5 because each time conflict with postgresql.

I try to force change the default directory of data as it was suggest in other post or change the sym link to the 14 version which is install but not use. and I cannot find whe the pg-upgrade manage to find the wrong version in all the log/conf file.

Thank you for your time.

Perhaps the old postgresql binaries are still running, I would suggest doing:

gitlab-ctl restart
systemctl restart gitlab-runsvdir

and then try again. If not, you mention Gitlab 14 data directory is there but not in use, which doesn’t make much sense. Either it upgraded postgresql OK, or it didn’t. In which case something has gone wrong with your system, you may wish to restore from backup. Maybe your postgresql upgrade partially failed, and now you have unstable system because of it.

Hello,
Thank you for your respond the old postgresql are running but the Gitlab 14 data directory is not present.

I miss lead you because I switch the binary to the 14 version but I got an error has the data is for the 13 version and not the 14.

I am still wondering where

/opt/gitlab# gitlab-ctl pg-upgrade

Get is information to check if the version is the good on because I check my config of gitlab.rb but the version of postgresql is comment so should not be use.

So i am wondering if I can just try to modify the conf file that pg_upgrade check to relance the upgrade.

Regards

Switch the binary? That’s not how you upgrade PostgreSQL. You use the appropriate commands to do it. I suggest you revert whatever you did, since it seems to me it wasn’t the correct procedure.

Yes I switch back as it was at the start because it didn’t work and it didn’t solve my issue.

And I would like to know where is the config our other file that pg_upgrade use to check the current version.