My service cannot be accessed within the local network, please help!

wujiuye
HOBBY

2 years ago

My front-end service has been unable to access the remote service.
I cannot verify whether the intranet is available by executing a command through the shell.
Faced with this problem, how should we users troubleshoot it?
nginx: [emerg] host not found in upstream "md_render.railway.internal:8090" in /etc/nginx/nginx.conf:23

8090 has enabled IPv6.

3 Replies

wujiuye
HOBBY

2 years ago

The front-end service is accessing the internal back-end service mdrender using the domain name mdrender.railway.internal.


wujiuye
HOBBY

2 years ago

Similarly, it's also not possible to access the database through the internal domain name.

[error] failed to initialize database, got error dial tcp: lookup mysql.railway.internal on 8.8.8.8:53: no such host
panic: dial tcp: lookup mysql.railway.internal on 8.8.8.8:53: no such host


wujiuye
HOBBY

2 years ago

I have found the answer.

Workaround for Alpine-based images
During private networking initialization (the period under 100ms), DNS resolution is handled via a fallback DNS server 8.8.8.8 in the container DNS config.

In Alpine-based images, due to how DNS resolution is handled, if that public DNS server's response is faster than the private networking DNS, it causes private resolution to fail.

You can workaround this issue by adding ENABLEALPINEPRIVATE_NETWORKING=true in your service environment variables. This will effectively remove the fallback DNS server 8.8.8.8 which is used during the private networking 100ms initialization period.


My service cannot be accessed within the local network, please help! - Railway Help Station