Why is my database produce-volume at 0?
smartsi-dash
HOBBYOP

22 days ago

image.png

Attachments

$10 Bounty

2 Replies

Status changed to Open Railway 22 days ago


Is that volume attached to your database service? And can you share the mount path as well?


ve-jo
HOBBYTop 5% Contributor

21 days ago

A Railway volume showing 0 usually means the database is not actually writing to that mounted path, or the volume is attached to a different service/path than the database data directory.

For Postgres, the important thing to check is the mount path. It should be mounted where Postgres stores its data, normally:

/var/lib/postgresql/data

You can verify from inside the database service with:

echo "$RAILWAY_VOLUME_MOUNT_PATH"

df -h "$RAILWAY_VOLUME_MOUNT_PATH"

du -sh "$RAILWAY_VOLUME_MOUNT_PATH"

If the volume is mounted somewhere else, Postgres can still run, but it may be writing to the container filesystem instead of the persistent volume, so Railway will show the attached volume as empty.

Also note that Railway volumes are only mounted at runtime, not during build/pre-deploy, so anything written before the service starts will not appear on the volume.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...