No PORT env var available
mjohnson459
HOBBYOP

10 months ago

I have a few services running and they are all connecting well both internally and externally using a "target port". Each service has its port configured via a specific variable, e.g. CORE_PORT, MCP_PORT. The target port is then set up to look at these.

The problem I have is when I want to add health checks. With no changes, the health check always fails due to "service unavailable". Going from this doc, https://docs.railway.com/guides/healthchecks, it seems like it requires the service to use the port defined by PORT, however this doesn't seem to be set? I changed the MCP_PORT to MCP_PORT="${{PORT}}" but it's left as blank for the health check.

Is there some special way to handle the PORT env var? Does it still exist?

Solved

3 Replies

Railway
BOT

10 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


mjohnson459
HOBBYOP

10 months ago

So, I inverted it on one service to PORT=${{MCP_PORT}} and this actually worked. However I have another service this failed with. The difference seems to be that the MCP service uses an ipv4 host of 0.0.0.0 and the failing one uses an ipv6 host of :: . Do the health checks work using ipv6?


10 months ago

There's definitely some ipv4/ipv6 shinannigans going on until we rollout our ipv4 overlay this week or next

Definitely want to be binding to ipv6 for now


Status changed to Awaiting User Response Railway 10 months ago


Railway
BOT

9 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 10 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...