2 months ago
Production emergency - PostgreSQL service keeps deploying PG18 but my data volume was initialized with PG17. Getting fatal error: 'The data directory was initialized by PostgreSQL version 17, which is not compatible with this version 18.3'. Need to either force PG17 image to stick or run pg_upgrade. Site has been down 3+ hours. How do I fix this?
15 Replies
2 months ago
Try deploying a custom Postgres image with the 17 tag, then mount the volume onto it afterwards.
2 months ago
Alternatively, you can go into your Postgres service settings, set a custom deploy command for sleep infinity, then run the pg_upgrade command through SSH.
2 months ago
Getting further now with ghcr.io/railwayapp-templates/postgres-ssl:17 but hitting: 'unrecognized configuration parameter autovacuum_worker_slots in postgresql.conf line 687'. What specific 17.x version tag should I use, or how do I override that config parameter?
2 months ago
when I SHH in and try pg_upgrade I Gte "pg_upgrade: cannot be run as root
Failure, exiting
"
2 months ago
Okay here's what I'd try.
2 months ago
Set the custom command to sleep infinity.
2 months ago
i finally got it, my backup from the last restore point has been running over an hour. its 1.3 GB is that typical
2 months ago
Then, run (This would've commented out the PG18 config that broke PG17).sed -i 's/^[[:space:]]*autovacuum_worker_slots[[:space:]]*=/#&/' "${PGDATA}/postgresql.conf".
2 months ago
Oh. XD
2 months ago
Volume size? Or memory?
2 months ago
volume
2 months ago
Probably normal? It's a full backup IIRC.
2 months ago
yes full back up, after one hour stats whos only 8.5mb so far
2 months ago
shows only*
2 months ago
Solved the issues thank you
Status changed to Solved 0x5b62656e5d • about 1 month ago