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
a month ago
Try this:
- This step is optional, but highly recommended: Backup the current volume in case something fatal happens. (Postgres service -> Backups -> New backup)
- Set your Postgres start command to be sleep infinity and redeploy.
- SSH into the container by clicking "Copy SSH Command" when right clicking Postgres
- Run
su postgres, followed bypg_resetwal -f /var/lib/postgresql/data/pgdata - There should be a log that says "Write-ahead log reset"
- Remove the custom start command and redeploy