Volume stuck resizing on production db
mfvas
PROOP

2 months ago

Hey Railway

My volume is stuck resizing. It's just "resizing volume..." forever.

I get an error if I try resizing again, and I've also tried restarting the attached service.

It's critical as it's my production volume.

Solved

6 Replies

Railway
BOT

2 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


mfvas
PROOP

2 months ago

The resizing seems to be done, but now the postresql server keeps crashing with:

2026-01-10 18:51:55.902 UTC [5] FATAL: bogus data in lock file "postmaster.pid": ""

Certificate will not expire

PostgreSQL Database directory appears to contain a database; Skipping initialization

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/XXXX


mfvas
PROOP

2 months ago

I fixed it by setting this as start command: rm -f /var/lib/postgresql/data/pgdata/postmaster.pid and then reverting to my normal start command.

To be completely honest: these quirks makes me consider switching away from Railway. All these pains really shouldn't be there just to grow a volume, and it's not the first time I've had to dive deep into this community and Google to fix something. I pay a relatively big premium for Railway over something like Coolify to not having to fix these things myself, as a complete rookie, with half a day's downtime.


sam-a
EMPLOYEE

2 months ago

Hi,

So glad you were able to solve your issue. We really appreciate you being a Railway customer. Unfortunately this issue relates to Postgres and can occur regardless of what platform you are on. We aim to make Railway easy to use, but we cannot solve all third-party software complexities unfortunately.

Let us know if we can be of further help.


Status changed to Awaiting User Response Railway 2 months ago


mfvas
PROOP

2 months ago

Thanks, but how can a volume resizing that didn't work on multiple tries and took 2-3 hours before getting a "result" and seemingly corrupted something in the postgres not be platform related? I don't think it's postgres that handles the disk volume?


Status changed to Awaiting Railway Response Railway 2 months ago


sam-a
EMPLOYEE

2 months ago

Again, sorry for your frustration -- this happens if/when Postgres doesn't shut down cleanly. In this case, it was terminated before it could do a graceful shutdown.

PostgreSQL uses postmaster.pid as a lock file to prevent multiple instances from running. When PostgreSQL starts, it writes its process ID to this file. On clean shutdown, it removes the file. Since it was killed during the resize, the file remained.

To help prevent this in the future, you can add a railway.json with a longer shutdown grace period:

json

{
  "deploy": {
    "stopGracePeriodSeconds": 30
  }
}

Let us know if you need more help.


Status changed to Awaiting User Response Railway 2 months ago


Railway
BOT

2 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway about 2 months ago


Loading...