Private networking not working
Getting this error while trying to connect via private networking within a project
Solution:Jump to solution
that is the start command for voiceless-cap.railway.internal?
if so, that would only work to expose your app via the public network.
0.0.0.0
is an ipv4 address and the private network is ipv6 only.
to run uvicorn listening on an ipv6 address you would want to use the start command as follows
uvicorn api:app --host :: --port $PORT
...15 Replies
Project ID:
2504e51b-d885-44bb-8f3f-39a0cca99259
2504e51b-d885-44bb-8f3f-39a0cca99259
does the project you are trying to connect to have App Sleeping enabled?
Where can i check that?
in your service settings
but if you don't know about it then you likely don't have it enabled
Can't find any such option in the settings
Oh yea, it's a beta feature, I forgot
It's not the issue here
How can i fix the issue?
I am using python's fastAPI for the API and running via uvicorn.
uvicorn api:app --host 0.0.0.0 --port ${PORT}
The public endpoint seems to be working fine but private doesn't
someone else just opened a thread saying they're having issues with private networking too
perhaps it's a railway error 🤔
Been facing it for quite some time, not a recent issue for me
I found a workaround for my case.
Even though I had been working for months, suddenly it was getting the private dns error.
I found docs that said private networking is not available immediately and added a noop delay for 5s and then everything was working again. YMMV
@Fragly can you look into the issue?
Afraid I have no idea what the issue is, best just wait for someone who knows more than I do
Solution
that is the start command for voiceless-cap.railway.internal?
if so, that would only work to expose your app via the public network.
0.0.0.0
is an ipv4 address and the private network is ipv6 only.
to run uvicorn listening on an ipv6 address you would want to use the start command as follows
uvicorn api:app --host :: --port $PORT
but unfortunately uvicorn doesn't support dual stack binding (ipv4 and ipv6)
so while this will work to make your app accessible over the private network, public access will not longer work, if that's fine for you then stop here!
if you need both public and private access, I suggest using hypercorn, it should be a drop in replacement, add it to your requirements.txt and then use this start command
hypercorn api:app --bind [::]:$PORT
this will bind to all ipv4 and ipv6 addresses and allow your app to be accessed publicly and privatelytl;dr this isn't a railway issue