railway internal network is unreadable
Solution:Jump to solution
try setting the
ENABLE_ALPINE_PRIVATE_NETWORKING=true
envvar per the docs on all the alpine containers?26 Replies
Project ID:
1f736e16-6743-4b65-ac36-e7b8aca242da
projectID : 1f736e16-6743-4b65-ac36-e7b8aca242da
is that the correct domain name for the service?
at what point in your apps lifecycle do you make a call this this internal service
exactly the internal domain
i use frontend web framework nextjs, and proxy api/* the backend internal sever call 'dify-flask'
I'm sorry but that doesn't quite answer the question
it use nodejs proxy to backend api server
log show dns lookup fail
at what point in your apps lifecycle do you make a call this this internal service
when browser call http://exapmle.com/api/foo/bar ,
nodejs proxy to backend http://dify-flask.railway.internal:5001/foo/bar
okay thank you
has this exact code worked in the past?
yes
have you tried a redoployment?
redoployment twice . both frontend and backend
@fp could there be a problem with private network resolution?
Interesting. Let me raise internally and find out.
Is the container using alpine by chance? Or musl libc? The DNS resolution for that is slightly different and we have a note in the docs about it: https://docs.railway.app/reference/private-networking#workaround-for-alpine-based-images
(We're working on a fix for that particular problem)
FROM node:18.17.0-alpine
Solution
try setting the
ENABLE_ALPINE_PRIVATE_NETWORKING=true
envvar per the docs on all the alpine containers?OK, i try it now
to give some background, we put both our internal DNS server and a public DNS resolver in
resolv.conf
. The dns lookup functions in glibc will treat the second entry as a fallback (desired behaviour since we want public DNS to work even if our internal resolver is unavailable), MUSL libc (used by alpine) is different: it sends out parallel requests to all resolvers in resolv.conf
and errors on the first failure. Because public DNS doesn't have the railway.internal
zone, privnet lookups can fail on Alpine.it works now
what the magic envvar above does is it removes the fallback
resolv.conf
entry, the only caveat with this is that it means public DNS resolutions are only available with privnet initialization (which is usually ~ 100ms after container startup).
Again this sucks, so we're actively playing with a fix for itnetwork issue occur again today
@char8
do not ping the team #🛂|readme #5