a month 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
a month ago
Try deploying a custom Postgres image with the 17 tag, then mount the volume onto it afterwards.
a month 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.
a month ago
Getting further now with ghcr.io/railwayapp-templates/postgres-ssl:17 but hitting: 'unrecognized configuration parameter autovacuumworkerslots in postgresql.conf line 687'. What specific 17.x version tag should I use, or how do I override that config parameter?
a month ago
when I SHH in and try pgupgrade I Gte "pgupgrade: cannot be run as root
Failure, exiting
"
a month ago
Okay here's what I'd try.
a month ago
Set the custom command to sleep infinity.
a month 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
a month ago
Then, run sed -i 's/^[[:space:]]*autovacuum_worker_slots[[:space:]]*=/#&/' "${PGDATA}/postgresql.conf". (This would've commented out the PG18 config that broke PG17).
a month ago
Oh. XD
a month ago
Volume size? Or memory?
a month ago
volume
a month ago
Probably normal? It's a full backup IIRC.
a month ago
yes full back up, after one hour stats whos only 8.5mb so far
a month ago
shows only*
a month ago
Solved the issues thank you
Status changed to Solved 0x5b62656e5d • about 1 month ago