🚨 URGENT: Locked out of Postgres SSH - Persistent Volume Permission Issue
leomach
HOBBYOP

23 days ago

Hey team! My Postgres DB is crash-looping since the GCP outage. Data is intact, but the persistent disk has corrupted permissions:

FATAL: private key file "/var/lib/postgresql/data/certs/server.key" must be owned by the database user or root

Why I need an Infra Engineer (Self-serve options failed):

Support suggested overriding the Start Command with sleep infinity to fix via SSH. This fails. The Postgres ENTRYPOINT script hits the permission error and kills the container before the sleep command runs or SSH can connect. Pre-deploy commands also fail (volume isn't mounted yet).

I am physically locked out. Could someone please manually run chown postgres:postgres (or 70:70) and chmod 600 directly on my persistent disk for /certs/server.key?

Project URL: https://railway.com/project/7334c5e7-1bd7-455a-92dc-83e3a83acbe8/service/219e1c34-4aa7-46f3-9cb7-28b9037a2cce?environmentId=1768e632-5533-42b1-8663-02e81d79d566

Thanks for the hard work! 🙏

2 Replies

Try setting the start command to bash -c "chown postgres:postgres /var/lib/postgresql/data/certs/server.key && chmod 600 /var/lib/postgresql/data/certs/server.key" and redeploy the service. Once it’s successfully redeployed and online, remove the custom start command and redeploy again.


leomach
HOBBYOP

23 days ago

Hey! I just tried your exact suggestion, but it resulted in the same crash loop.

It seems the image's ENTRYPOINT script evaluates the PGDATA directory and hits the FATAL: server.key must be owned by the database user error, which crashes the container before the custom bash -c Start Command can successfully execute the fix.

Because it crash-loops instantly at the entrypoint level, none of the Start Command overrides (bash -c chown... or sleep infinity) are able to bypass it. I am completely locked out.

Could an infrastructure engineer please manually run the chown/chmod directly on my persistent volume from the host level? It's the only way to break the loop at this point.

Thanks!


Welcome!

Sign in to your Railway account to join the conversation.

Loading...