Postgres Corruption after resizing
matteo-ms
PROOP

20 days ago

Hi, after hitting 99% of size limit, I decided to upsize my Postgres DB to 250GB.

During redeploy, error:"Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/0da22078-38ce-4077-9f5a-9b4213a8965a/vol_56nbw3scd0xyr8dy

Starting Container

PostgreSQL Database directory appears to contain a database; Skipping initialization

2026-01-19 16:13:53.422 UTC [2] FATAL: bogus data in lock file "postmaster.pid": """

I do not know what to do, I've tried to unlock the file, migrate the data (it seems to be safe and not impacted but nothing to do..)

Please, help me on unstucking the service.

Production is down

$20 Bounty

2 Replies

Railway
BOT

20 days ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open Railway 20 days ago


darseen
HOBBYTop 1% Contributor

19 days ago

You need to manually delete postmaster.pid from your database's data directory. Since your service is crash looping, you can't ssh into it directly.

Here are the steps you need to follow in order to delete postmaster.pid :
Make sure you have railway cli installed.

1. Set the start command in your postgres service to: sleep infinity
2. Right click on you postgres service and click copy ssh command
3. SSH into your service, and locate postmaster.pid (check in /var/lib/postgresql/data) and delete it using rm postmaster.pid
4. Remove the start command sleep infinity
5. Redeploy


darseen

You need to manually delete postmaster.pid from your database's data directory. Since your service is crash looping, you can't ssh into it directly.Here are the steps you need to follow in order to delete postmaster.pid :Make sure you have railway cli installed.1. Set the start command in your postgres service to: sleep infinity2. Right click on you postgres service and click copy ssh command3. SSH into your service, and locate postmaster.pid (check in /var/lib/postgresql/data) and delete it using rm postmaster.pid 4. Remove the start command sleep infinity5. Redeploy

matteo-ms
PROOP

19 days ago

I've tried your solution but it didn't work. I delete all postmaster.* (as postmaster.opts) and I managed to start the database that resulted corrupted, so I had to transfer all the workflows manually.

Thanks for the support btw


Loading...