Public Networking 502, internal network still works

mikeyliow
HOBBY

12 days ago

  • Running into 502 issues when accessing my service via public endpoint

  • Internal Network (another service calls this service) shows that the service works as usual via internal network

  • already tried to reconfigure the public endpoint and deployed, still same issue

here is the HTTP Log error + request ID

requestId:
"3rkQdlHCQ9mXIFhl0ubPiw"
timestamp:
"2025-08-17T07:21:27.627771996Z"
method:
"GET"
path:
"/"
host:
"yasha-staging.up.railway.app"
httpStatus:
502
upstreamProto:
""
downstreamProto:
"HTTP/2.0"
responseDetails:
"Retried single replica"
totalDuration:
710
upstreamAddress:
""
clientUa:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"
upstreamRqDuration:
708
txBytes:
4682
rxBytes:
898
srcIp:
"211.24.209.216"
edgeRegion:
"unknown"
upstreamErrors:
"[{"deploymentInstanceID":"b2000ae0-590f-4686-9ca1-9e9ec2eb33f7","duration":236,"error":"connection refused"},{"deploymentInstanceID":"b2000ae0-590f-4686-9ca1-9e9ec2eb33f7","duration":236,"error":"connection refused"},{"deploymentInstanceID":"b2000ae0-590f-4686-9ca1-9e9ec2eb33f7","duration":236,"error":"connection refused"}]"

Attachments

$10 Bounty

9 Replies

Railway
BOT

12 days 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!


11 days ago

Hey, this sounds like an issue with the port configuration within the public networking section. Have you tried out the possible solutions outlined in the docs?


uxuz

Hey, this sounds like an issue with the port configuration within the public networking section. Have you tried out the possible solutions outlined in the docs?

mikeyliow
HOBBY

11 days ago

thanks for the suggestion, but the port is correct and was working fine previously, not sure what changed..


10 days ago

Hey, can you provide a sceenshot of your service's public networking section and provide a snippet of your code for the networking part.


uxuz

Hey, can you provide a sceenshot of your service's public networking section and provide a snippet of your code for the networking part.

mikeyliow
HOBBY

4 days ago

hey @uxuz i found that uvicorn doesnt support dual binding, which is weird because i was using both private n public at one point. its okay tho, since its written in the doc i cant dispute it anyway, thanks!

https://docs.railway.com/guides/private-networking#python--uvicorn
```
Python / Uvicorn

Update your start command to bind to IPv6.

uvicorn app:app --host :: --port ${PORT-3000}

Note: If your application needs to be accessible over both private and public networks, your application server must support dual stack binding. Most servers handle this automatically when listening on ::, but some, like Uvicorn, do not.
```


mikeyliow

hey @uxuz i found that uvicorn doesnt support dual binding, which is weird because i was using both private n public at one point. its okay tho, since its written in the doc i cant dispute it anyway, thanks!https://docs.railway.com/guides/private-networking#python--uvicorn```Python / UvicornUpdate your start command to bind to IPv6.uvicorn app:app --host :: --port ${PORT-3000}Note: If your application needs to be accessible over both private and public networks, your application server must support dual stack binding. Most servers handle this automatically when listening on ::, but some, like Uvicorn, do not.```

4 days ago

Interesting, have you tried using Hypercorn? It should support dual stack binding.


shxkm
PROTop 10% Contributor

4 days ago

Does your app have a concept similar to ALLOWED_HOSTS (Django)? If so, is your public hostname in that list?


shxkm
PROTop 10% Contributor

4 days ago

Sorry, just now seeing your most recent reply. I’m using Gunicorn with uvicorn workers successfully on Railway.


mikeyliow

hey @uxuz i found that uvicorn doesnt support dual binding, which is weird because i was using both private n public at one point. its okay tho, since its written in the doc i cant dispute it anyway, thanks!https://docs.railway.com/guides/private-networking#python--uvicorn```Python / UvicornUpdate your start command to bind to IPv6.uvicorn app:app --host :: --port ${PORT-3000}Note: If your application needs to be accessible over both private and public networks, your application server must support dual stack binding. Most servers handle this automatically when listening on ::, but some, like Uvicorn, do not.```

shxkm
PROTop 10% Contributor

4 days ago

And, if you’re OK with configuring the server in code, there’s a workaround that enables dual stack:

https://github.com/encode/uvicorn/discussions/1529#discussioncomment-10044311


Public Networking 502, internal network still works - Railway Help Station