Issues with connecting between two running pods
robmillersoftware
PROOP

22 days ago

I've got my API pod trying to connect to a service I wrote. It was working just fine via the public URL for months, but suddenly I'm getting timeouts on every call. I tried switching to the private (internal) domain, but all connection attempts are failing. I've tried:

https://${{servicename.RAILWAY_PRIVATE_DOMAIN}}

http://${{servicename.RAILWAY_PRIVATE_DOMAIN}}

http://${{servicename.RAILWAY_PRIVATE_DOMAIN}}:${{servicename.PORT}}

None of those worked. This is an absolute deal breaker for me, and I'm going to need to start looking for a new deployment platform if this isn't resolved soon.

Solved$20 Bounty

Pinned Solution

Is your application listening on v6?

4 Replies

sam-a
EMPLOYEE

22 days ago

The private domain syntax you're using won't work as written - the ${{servicename.RAILWAY_PRIVATE_DOMAIN}} reference variable syntax only works when setting environment variables, not in raw URL strings at runtime.

To connect services privately, set an environment variable like BACKEND_URL=http://${{servicename.RAILWAY_PRIVATE_DOMAIN}}:${{servicename.PORT}} and then use that env var in your code. Alternatively, use the internal DNS directly: http://servicename.railway.internal:PORT (replace servicename with your target service's actual name and PORT with the port it listens on).

Also note: use http:// for private networking, not https:// - internal traffic is already encrypted via Wireguard.

Which service is your API trying to reach? I can verify the internal connectivity between them.


Status changed to Awaiting User Response Railway 22 days ago


robmillersoftware
PROOP

22 days ago

Sorry, I wasn't very clear on that. Those were environment variables (CONTEXT_ENGINE_URL). This is the connection from cahoots-api to contex, specifically, but I've had issues using private networking in other places as well. I'm guessing it is IPv6-related, but transport isn't really my cup of tea.


Status changed to Awaiting Railway Response Railway 22 days ago


Railway
BOT

22 days 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 Railway 22 days ago


robmillersoftware

Sorry, I wasn't very clear on that. Those were environment variables (CONTEXT_ENGINE_URL). This is the connection from cahoots-api to contex, specifically, but I've had issues using private networking in other places as well. I'm guessing it is IPv6-related, but transport isn't really my cup of tea.

Is your application listening on v6?


robmillersoftware
PROOP

22 days ago

That was the issue. I had accidentally hardcoded my server to use 0.0.0.0. It's now using :: and is working correctly. Thanks for the help!


Status changed to Solved brody 21 days ago


Loading...