25 days ago
I have database deployed based on the ghcr.io/railwayapp-templates/timescale-postgis-ssl:pg17-ts2.17 template. I was looking at the new Postgres metrics available and pressed the button to enable query statistics and it crashed/failed to deploy. I tried to redeploy+restart but it's still crashed.
The last logs in the deploy are:
[inf] PostgreSQL Database directory appears to contain a database; Skipping initialization
[inf]
[err] 2026-02-14 23:15:54.537 UTC [5] FATAL: could not access file "timescaledb,pg_stat_statements": No such file or directory
[err] 2026-02-14 23:15:54.537 UTC [5] LOG: database system is shut down
[inf] Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/1135ed2b-12a8-43aa-9ece-7ff89eb0908b/vol_y1rxkf74zeztyr1u
[inf] Certificate will not expire
[inf]
[inf] PostgreSQL Database directory appears to contain a database; Skipping initialization
[inf]
[err] 2026-02-14 23:16:17.176 UTC [5] FATAL: could not access file "timescaledb,pg_stat_statements": No such file or directory
[err] 2026-02-14 23:16:17.176 UTC [5] LOG: database system is shut down
Can post the full logs if it would be helpful
1 Replies
25 days ago
I followed the advice in this thread https://station.railway.com/questions/postgres-crashing-after-enable-stats-fea-1a2bfbf8 "The most straight forward way would be to just SSH into the service and remove the quotes from "timescaledb,pgstatstatements" in the [postgresql.auto](postgresql.auto).conf file."
I've done this which appears to have fixed it for now. For anyone else: (set custom start command, sleep infinity) so container will start first, railway link, railway ssh in, run "sed -i "s/shared_preload_libraries = '\"timescaledb,pg_stat_statements\"'/shared_preload_libraries = 'timescaledb,pg_stat_statements'/" /var/lib/postgresql/data/pgdata/postgresql.auto.conf", remove custom start command, redeploy
let me know if there is a more permanent/better fix I should do.
Status changed to Solved medim • 25 days ago