PostgreSQL down 3+ hours - 100+ orphaned replication slotsError: "could not find free r
autogrpaph
HOBBYOP

3 months ago

🚨 URGENT: PostgreSQL crashed - n8n is completely down (3+ hours)

Hello Railway Support Team,

My PostgreSQL database has been crashed for over 3 hours and my n8n instance is completely unusable. I'm getting this error from n8n:

{"code":503,"message":"Database is not ready!"}
Error Details: PostgreSQL keeps crashing during startup with this error:

PANIC: could not find free replication state, increase maxreplicationslots
LOG: startup process (PID XX) was terminated by signal 6: Aborted
LOG: database system is shut down
Project Information:

Project ID: bda10a9c-c154-4da8-a76e-00f91422324b
Service ID: 40df36be-de68-4c3d-a5dd-f76e1e8350f6
Environment: production
Service: PostgreSQL (crashed status)
What I've tried:

Changed PGCONFIGMAXREPLICATIONSLOTS to 10, 50, 200, 300 - nothing works Added pre-deploy commands to clean pgreplslot - doesn't execute in time
Modified start commands - permission errors
Waited for auto-recovery - keeps crash looping
Root Cause: The database has 100+ orphaned replication slots in /var/lib/postgresql/data/pg_replslot/ directory. PostgreSQL tries to load them during recovery and runs out of available slots before configuration is applied.

What I need: Please help clean the /var/lib/postgresql/data/pg_replslot/ directory so my database can start. All my n8n workflows are down and I cannot access my data.

Impact:

n8n completely unusable (503 error)
All workflows stopped
Production system down for 3+ hours
Business operations affected
Please help as soon as possible! 🙏

Thank you!

Closed

3 Replies

autogrpaph
HOBBYOP

3 months ago

{"code":503,"message":"Database is not ready!"}


How did you increase your max replication slot?


3 months ago

Please do not create duplicate threads.


Status changed to Closed brody 3 months ago


Loading...