a month ago
My PostgreSQL service has been down for 6 days with this fatal error on every startup:
FATAL: "min_wal_size" must be at least twice "wal_segment_size"
Root cause: postgresql.auto.conf on the volume has an invalid min_wal_size value (set via ALTER SYSTEM in a previous session). PostgreSQL can't start at all because of this.
Fix needed: Delete or truncate /var/lib/postgresql/data/pgdata/postgresql.auto.conf on the volume. This is a one-line fix with no data loss.
The AI assistant already tried to create a helper service but it didn't deploy correctly. I need a human engineer to either:
Mount the volume to a temp container and delete postgresql.auto.conf, OR
Start PostgreSQL once with -c min_wal_size=80MB as a command-line override to bypass the bad config
2 Replies
a month ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open Railway • about 1 month ago
a month ago
wal_segment_size is set to 16MB by default, and min_wal_size is 80MB by default. Since the value of min_wal_size was changed; you need to SSH into your postgres service and edit postgresql.conf file to set min_wal_size back to 80MB.
To SSH into your service:
- Set the start command to sleep infinity to avoid postgres from crashing and preventing you from SSHing into the container.
- Open the file at /var/lib/postgres/data/postgresql.conf and add/edit the line: min_wal_size = 80MB
- Remove the start command and redeploy your service.
a month ago
@buzz-hive-life's approach is the cleaner fix here. Use postgres -c min_wal_size=80MB as a Start Command override to bypass the bad postgresql.auto.conf without needing SSH or volume mounting. Once the service comes up, connect to the database and run:
ALTER SYSTEM SET min_wal_size TO '80MB';That writes the correct value back to postgresql.auto.conf so the fix is permanent. Then remove the Start Command override and redeploy.
Thanks to @buzz-hive-life and @darseen for the solutions. Marking this resolved.
Status changed to Awaiting User Response Railway • about 1 month ago
Status changed to Solved angelo-railway • about 1 month ago