Postgresql pg_upgradecluster error

Hi !

I’m trying to upgrade my postgresql 15 cluster to postgresql 16 with the pg_upgradecluster command. Knowing that I have a main node and 2 replicas with synchronous streaming. When I tried to run pg_upgradecluster on the master node, I get this message at the end of the update:

Starting new cluster…
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Error: /usr/lib/postgresql/16/bin/pg_ctl /usr/lib/postgresql/16/bin/pg_ctl start -D /var/lib/postgresql/16/main -l /var/log/postgresql/postgresql-16-main.log -s -o -c config_file=“/etc/postgresql/16/main/postgresql.conf” -c hba_file=/tmp/pg_hba.kPCk7M.conf exited with status 1:
2024-04-11 13:50:32.591 CEST [2336036] FATAL: could not access file “timescaledb”: No such file or directory
2024-04-11 13:50:32.591 CEST [2336036] LOG: database system is shut down
pg_ctl: could not start server
Examine the log output.
Error: Could not start target cluster

Hi Valentin, seems like timescaledb is not available in the PG16. Can you confirm that the timescaledb files are in the right folder?

If the error occurs immediately after updating your version of TimescaleDB and the file mentioned is from the previous version, it is probably due to an incomplete update process. Within the greater PostgreSQL server instance, each database that has TimescaleDB installed needs to be updated with the SQL command ALTER EXTENSION timescaledb UPDATE; while connected to that database. Otherwise, the database looks for the previous version of the timescaledb files.

Have you checked troubleshooting section?


I fixed this problem but now I was wondering in what order I should update my postgresql nodes.

I don’t know if you are able to answer me but I ask anyway ^^

Thanks in advance.

Every extension contains files from previous versions and actual version. If you update and install all details on replicas and the primary, you’ll still have the old version running until you explicit alter extension ... update. You should only make it in the primary and the replicas will just follow it.