6 months ago
Hi,
I'm experiencing an issue with Private Networking between two services in my project.
Setup:
- Service 1: Next.js app with Private Networking enabled
- Service 2: MySQL database with Private Networking enabled
- Both services show green checkmark and "Ready to talk privately"
Problem: My Next.js app cannot reach the MySQL database using the internal URL (mysql.railway.internal:3306). The connection fails with:
Can't reach database server at mysql.railway.internal:3306However, when I use the public URL (MYSQL_PUBLIC_URL), the connection works perfectly.
Context: This issue started after I duplicated my workspace to create a "dev" environment and then deleted that duplicate project. Before this, the internal networking was working fine.
What I've tried:
- Verified Private Networking is enabled on both services
- Restarted both services
- Redeployed both services
- Deleted and recreated the
DATABASE_URLvariable
Could you please investigate why the private network connection is failing between these services?
Thank you.
1 Replies
6 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 Private networking: service cannot reach Postgres at postgres.railway.internal:5432 (works only via DATABASE_PUBLIC_URL)
- 🧵 Error: P1001: Can't reach database server at
postgres.railway.internal:5432(During build) - 🧵 Next.js + MongoDB Private URL on Railway - Connection Issues During Deployment
If you find the answer from one of these, please let us know by solving the thread!