Postgress container upgrade from 14.x to 15.x failed

Team,
i have used this service for 1 year , and I just tried updating to the latest postgres image 15.x from 14.x and the container now fails to start with error message:

Postgres major version is newer than the existing DB, performing auto upgrade...
---------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Looks like the server did not previously shutdown properly which will prevent pg_upgrade from working
try stopping the whole stack, bringing only the postgresql container up and then stopping it again
-----------------------------------------------------------------------------------------------------

Hey,

OK so you tried to upgrade to the latest postgres and the upgrade failed; this is likely because you didn’t stop the existing stack (there is a bug in our 14.x postgres docker image which means it doesn’t respond to SIGINT message and ends up being killed by docker so the DB is left in a state that means auto upgrade will not run).

As the error message suggests: -

-----------------------------------------------------------------------------------------------------
Looks like the server did not previously shutdown properly which will prevent pg_upgrade from working
try stopping the whole stack, bringing only the postgresql container up and then stopping it again
-----------------------------------------------------------------------------------------------------

You just need to start the postgres container using the old image and then stop the stack, something like:

POSTGRESQL_VERSION=14.6.0.3 docker compose -p openremote up postgresql

Once it is running you can exit Ctrl-C and the DB should be stopped in a healthy state; you can then try bringing up the stack with the newer postgres image.

POSTGRESQL’s health is ok but the problem in keycloak , its restarted .

So you managed to upgrade the postgresql container successfully now?

If so please share error logs from keycloak.

1 Like