Postgres is crashed
twoqan
HOBBYOP

a month ago

My Postgres is crash-looping with No space left on device on pg_wal. Service won't start so I can't connect or SSH. Volume is 5GB, metrics show 0B usage. Need help clearing WAL files or re-mounting the volume. Project ID: a7dfef60-a932-4b6c-beb4-39691e0f2bef

1 Replies

Try this:

  1. This step is optional, but highly recommended: Backup the current volume in case something fatal happens. (Postgres service -> Backups -> New backup)
  2. Set your Postgres start command to be sleep infinity and redeploy.
  3. SSH into the container by clicking "Copy SSH Command" when right clicking Postgres
  4. Run su postgres, followed by pg_resetwal -f /var/lib/postgresql/data/pgdata
  5. There should be a log that says "Write-ahead log reset"
  6. Remove the custom start command and redeploy

Welcome!

Sign in to your Railway account to join the conversation.

Loading...