Internal networking broken - MySQL connection times out via .railway.internal
plamenzhl
HOBBYOP

2 months ago

My Spring Boot backend cannot connect to MySQL via internal networking. Connection times out after ~30 seconds. Public URL works fine.

Environment:
- Region: EU West (Amsterdam) — both services
- Backend: Spring Boot 3.4.6, Java 17, MariaDB JDBC driver
- Database: Railway MySQL
- Both services show "Online" status

Timeline:
- Working: ~4 hours ago
- Broken: After a routine git push (only changed a markdown file, no config changes)

What I Tested:
- Public URL works: jdbc:mariadb://turntable.proxy.rlwy.net:24191/railway
- Internal URL times out: jdbc:mariadb://mysql.railway.internal:3306/railway
- Reference variable times out: ${{MySQL.RAILWAY_PRIVATE_DOMAIN}}:3306

Error log:
- Socket fail to connect to address=(host=mysql.railway.internal)(port=3306)(type=primary). Connect timed out org.hibernate.exception.JDBCConnectionException: unable to obtain isolated JDBC connection

Steps to Reproduce:
1. Deploy backend with DATABASE_URL using mysql.railway.internal
2. Backend fails to start — connection timeout after ~30 seconds
3. Change DATABASE_URL to public proxy URL
4. Backend starts successfully

Expected:
- Internal networking should allow connection between services in the same project/region.

I am currently using public URL, but need internal networking for lower latency.

Thanks

Solved$10 Bounty

Pinned Solution

bbhoss
FREE

2 months ago

Allowing/forcing IPv6 connections fixed this issue for me with Postgres connecting from Elixir. Might help you.

2 Replies

bbhoss
FREE

2 months ago

Allowing/forcing IPv6 connections fixed this issue for me with Postgres connecting from Elixir. Might help you.


bbhoss

Allowing/forcing IPv6 connections fixed this issue for me with Postgres connecting from Elixir. Might help you.

plamenzhl
HOBBYOP

2 months ago

This worked! Thank you!


Status changed to Solved brody about 2 months ago


Loading...