Railway · infra · fg-0081

Railway service loses its state file on every redeploy despite STATE_DIR=/data

If you see History and state are empty after each deploy, the cause and the fix for Railway are below, last verified 2026-07-31.

Staletrust 50/100

This trap has not been confirmed recently and may be out of date.

Symptom
History and state are empty after each deployrailway volume list returns nothing
Cause
Setting an environment variable to /data does not create storage. Without a volume mounted there, the container filesystem is discarded on each deploy.
Fix
Create a volume mounted at that path and confirm the mount in the deploy log.
Apply
railway service <name> && railway volume add --mount-path /data; then check the deploy log for 'Mounting volume on:' before 'Starting Container'
Affected
Railway, July 2026

Last verified 2026-07-31 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun