2 months ago
Issue Description
My n8n production deployment on Railway has been down for 27 days. The Postgres service is failing to deploy with the error:
"This service requires a volume to be mounted at /var/lib/postgresql/data. Please attach a volume to the service and try again."
Critical Details
Project: talented-trust (Production) Affected Services:
Postgres (Build Failed)
n8n Primary (Depends on Postgres)
n8n Worker (Depends on Postgres)
Timeline:
Dec 3, 2024 02:55 UTC: Clean shutdown (SIGTERM received)
Dec 3 - Dec 30: 27 days offline
Dec 30, 2024: All restart attempts fail
Current status: Volume appears unmounted
Error Messages
From Postgres Deploy Logs:
This service requires a volume to be mounted at /var/lib/postgresql/data. Please attach a volume to the service and try again. Deployment failed
From Previous n8n Logs (before volume issue):
Error: connect ENETUNREACH fd12:6ed2:8b83:0:a000:69:f8ea:be69:5432 Could not establish database connection within 20,000 ms Connection terminated unexpectedly
Service Configuration
Postgres Service:
Docker Image: ghcr.io/railwayapp-templates/postgres-ssl:16
Region: us-east4-eqdc4a
Expected Mount: /var/lib/postgresql/data
PGDATA: /var/lib/postgresql/data/pgdata
Variables (Dynamic references):
DATABASE_URL=postgres://POSTGRESUSER:{{POSTGRES_USER}}: POSTGRESUSER:{{POSTGRES_PASSWORD}}@PGHOST:{{PGHOST}}: PGHOST:{{PGPORT}}/${{POSTGRES_DB}} PGHOST=${{RAILWAY_PRIVATE_DOMAIN}} PGPORT=5432 POSTGRES_DB=railway
What I've Tried
Multiple restart attempts on Postgres service
Checked Settings > Volumes (volume seems unmounted)
Verified variables are using Railway references (not hardcoded)
Checked standalone Postgres in separate project (also failing)
Unable to access volume to verify data integrity
Critical Need
Primary Goal: Extract n8n workflows from the database BEFORE recreating infrastructure
I need to:
Remount the existing volume (if data still exists)
Get Postgres running temporarily (even read-only)
Execute pg_dump or direct SQL queries to extract workflow data
Then proceed with fresh deployment if needed
Questions
Does the volume still exist with data? How can I verify this?
How do I remount an existing volume to the Postgres service?
Is there a way to access volume data directly without the Postgres service running?
Are there any automatic backups/snapshots from the past 30 days?
Project Settings show Volume Usage of $0.16, which suggests the volume and data still exist, but the service cannot mount it.
Attempted Solutions
Checked Volume settings (no volume appears mounted in service settings)
Attempted to add volume via Settings > Volumes
Verified service configuration matches template requirements
Environment
Railway Project ID: talented-trust
Postgres Version: 16 (ghcr.io/railwayapp-templates/postgres-ssl:16)
n8n Version: Latest (was working until Dec 3)
Other Services: Redis (Online), Primary (Failed), Worker (Failed)
Additional Context
This was a working production deployment for months. The 27-day offline period appears to have caused volume/network configuration issues. I have backups of environment variables but need database contents urgently.
Note: I also have a standalone Postgres project that's experiencing similar failures (build failed), suggesting this might be a broader issue.
Urgency Level
CRITICAL - Production data at risk of permanent loss
Any assistance with volume recovery or data extraction would be greatly appreciated.
Logs Available:
Postgres deploy logs showing volume mount error
n8n connection failure logs (ENETUNREACH errors)
Full error timeline from Dec 3 to present
Can provide additional logs or screenshots if needed.
1 Replies
2 months ago
Looking at your situation, the good news is that your volume likely still exists — the $0.16 usage charge confirms storage is being retained. The issue is that the volume became detached from your Postgres service, which can happen after extended periods of inactivity.
To reattach your existing volume:
Go to your Postgres service settings and look for the Volumes section
You should see an option to attach an existing volume — select the volume that was previously connected to this service
Make sure the mount path is set to
/var/lib/postgresql/dataRedeploy the service
If you don't see the existing volume as an option to attach, please share a link to your project (just copy the URL from your browser when viewing the project) and I can take a closer look at the volume state from our side.
Regarding backups: Railway doesn't provide automatic database backups — backups are the responsibility of the user. However, since your volume data appears to still exist based on the billing, recovering it by reattaching should be possible.
Once you get Postgres running again, I'd strongly recommend immediately running pg_dump to create a backup before doing anything else. You can do this via the Railway CLI or by connecting through the database connection tab.
Let me know if you're unable to find the volume attachment option and share that project link — I'll investigate further.
Status changed to Awaiting User Response Railway • 2 months ago
2 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 2 months ago