a month ago
Hello Railway Support Team,
I'm experiencing issues with TCP Proxy connectivity to my PostgreSQL database and need assistance.
Project Details:
Project: sunny-strength
Environment: production
PostgreSQL service: postgres-production-1337.up.railway.app
Port: 5432
Problem Description: I configured TCP Proxy for my PostgreSQL service to access it from outside Railway network, but all connection attempts fail with "connection timeout expired" error.
Steps I've taken:
Created TCP Proxy in Settings → Networking for PostgreSQL service
Generated domain: postgres-production-1337.up.railway.app
Deployed the changes (the deployment completed successfully)
Waited 10+ minutes for TCP Proxy to activate
Attempted connections using multiple PostgreSQL clients (psql, pgAdmin 4) with correct credentials
Connection parameters used:
Port: 5432
Database: railway
User: railway
Password: [correct password from PGPASSWORD variable]
Error received:
psql: error: connection to server at "postgres-production-1337.up.railway.app" (66.33.22.56), port 5432 failed: Operation timed out
Is the server running on that host and accepting TCP/IP connections?Additional context: The TCP Proxy appears configured correctly in the Railway dashboard, showing the domain and port 5432. However, no external connections can reach the database. Internal connections within Railway network work fine (my n8n service can connect using postgres.railway.internal).
What I need: I need to access the PostgreSQL database externally to run a SQL command (DELETE FROM "user";) to reset n8n user accounts, as I've lost access to the n8n admin panel.
Could you please:
Check if TCP Proxy is properly activated for my PostgreSQL service
Verify if there are any firewall or network issues blocking connections
Suggest alternative methods to access the database if TCP Proxy cannot be fixed
Thank you for your assistance!
2 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
🧵 PostgreSQL Database Connection Failure - "Connection terminated unexpectedly"
🧵 Internal network latency causing database and Redis connection timeouts
If you find the answer from one of these, please let us know by solving the thread!
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 brody • about 1 month ago
a month ago
Hi!
Easy fix! Remove the generated domain you created and add a TCP proxy. This is how Postgres will communicate. Make sure to point it to 5432.
EDIT: I noticed you said you created one, but the URL you're using to connect isn't it. Try removing both and recreating a TCP one.
Status changed to Solved samgordon • 16 days ago