Unreachable Network
I am starting nginx-proxy with this command
docker run --network code \
--name nginx-proxy \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-p 80:80 \
-d --restart always mesudip/nginx-proxy
And then starting another container like this
docker run --network code -e VIRTUAL_HOST="pg.lmao.dev -> :80" --expose 80 -d httpd
The domain is setup to point to my server and i have verified that it works.
After starting the second container and then running docker logs on the proxy container, i see an error saying " Unreachable Network". Whats causing this error ?
Hi @fero1xd, can you provide me full log of nginx-proxy container since startup? That will help me debug the issue.
@fero1xd , One reason might be because the proxy is not able to detect it's connected networks so that it's using "frontend" as fallback for network.
Hi @fero1xd, can you provide me full log of nginx-proxy container since startup? That will help me debug the issue.
Sure,
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
Using letsencrypt url : https://acme-v02.api.letsencrypt.org/directory
Nginx is alive
No VIRTUAL_HOST Id:13ae06dc3806 nginx-proxy
Nginx Reloaded Successfully
[SSL Refresh Thread] Looks like there no ssl certificates, Sleeping until there's one
Unreachable Network Id:30589a77fd47 httpd
Unreachable Network Id:30589a77fd47 httpd
Was working fine on my local machine, problems on ec2
@fero1xd , One reason might be because the proxy is not able to detect it's connected networks so that it's using "frontend" as fallback for network.
I did docker inspect on the container, can confirm its using my network
I tried reproducing it with the command you provided. Below is the logs.
[root@ip-xxx-test-infrastructure]# docker logs -f nginx-proxy
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
............+........................***
Using letsencrypt url : https://acme-v02.api.letsencrypt.org/directory
Nginx is alive
Valid configuration Id:a955e4011f28 gracious_booth
- http://pg.lmao.dev/
-> http://172.18.0.3:80/
No VIRTUAL_HOST Id:294987f9ff62 nginx-proxy
Nginx Reloaded Successfully
[SSL Refresh Thread] Looks like there no ssl certificates, Sleeping until there's one
Restarting the containers might help. Sometimes if a container starts right before nginx starts reading configuration, it might not register it.
Can you provide me the type of machine you are running it on? I am testing it on amazon-ec2, where it has no issues.
I tried reproducing it with the command you provided. Below is the logs.
[root@ip-xxx-test-infrastructure]# docker logs -f nginx-proxy Generating DH parameters, 2048 bit long safe prime, generator 2 This is going to take a long time ............+........................*** Using letsencrypt url : https://acme-v02.api.letsencrypt.org/directory Nginx is alive Valid configuration Id:a955e4011f28 gracious_booth - http://pg.lmao.dev/ -> http://172.18.0.3:80/ No VIRTUAL_HOST Id:294987f9ff62 nginx-proxy Nginx Reloaded Successfully [SSL Refresh Thread] Looks like there no ssl certificates, Sleeping until there's oneRestarting the containers might help. Sometimes if a container starts right before nginx starts reading configuration, it might not register it.
Can you provide me the type of machine you are running it on? I am testing it on amazon-ec2, where it has no issues.
Its ubuntu 2024
Using letsencrypt url : https://acme-v02.api.letsencrypt.org/directory
Nginx is alive
No VIRTUAL_HOST Id:784446db7b18 nginx-proxy
Nginx Reloaded Successfully
[SSL Refresh Thread] Looks like there no ssl certificates, Sleeping until there's one
Unreachable Network Id:2a73304aa15e xenodochial_williams
Valid configuration Id:2a73304aa15e xenodochial_williams
- http://pg.lmao.dev/
-> http://172.18.0.3:80/
Nginx Reloaded Successfully
Using your exact commands and in the order you started the containers, the image container is still discovered. Can you make sure that you started the containers with the same command, and the network names are correct?
Thanks for reporting the issue. I'll create a patch in a couple of days with extra logs so that it can be debugged easily in future.
Using letsencrypt url : https://acme-v02.api.letsencrypt.org/directory Nginx is alive No VIRTUAL_HOST Id:784446db7b18 nginx-proxy Nginx Reloaded Successfully [SSL Refresh Thread] Looks like there no ssl certificates, Sleeping until there's one Unreachable Network Id:2a73304aa15e xenodochial_williams Valid configuration Id:2a73304aa15e xenodochial_williams - http://pg.lmao.dev/ -> http://172.18.0.3:80/ Nginx Reloaded SuccessfullyUsing your exact commands and in the order you started the containers, the image container is still discovered. Can you make sure that you started the containers with the same command, and the network names are correct?
Thanks for reporting the issue. I'll create a patch in a couple of days with extra logs so that it can be debugged easily in future.
seems like this is a ubuntu 2024 issue.. I tried this with amazon linux just now and it worked fine for me.
seems like this is a ubuntu 2024 issue.. I tried this with amazon linux and it worked fine for me.
Nginx-Proxy immediately requests container details on receiving events. I have noticed that in some system, docker-daemon has a lag between sending events and updating its internal state. It was very rare and hard to reproduce.
Thanks for trying it out on different server. I'll add this in TODO.
There is also an issue with Docker version 27.1.1, build 63125853e3 running on archlinux
This issue is fixed on latest version.
There was a change in docker api. it was returning Null in aliases instead of empty array :[]