Closed heidricha closed 2 years ago
I have no idea about the nginx options. If normal dns works then this is not an issue with podman.
I see you use cni you may want to test with netavark/aardvark-dns instead which should have better dns support.
I think I have a similar issue where the nginx lookup occasionally fails with podman 4.1.0 and netavark, but not always:
ex:
10.89.0.80 - - [14/Jun/2022:02:35:06 +0000] "GET /api/settings HTTP/1.1" 200 53 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" "-"
10.89.0.80 - - [14/Jun/2022:02:35:07 +0000] "GET /api/settings HTTP/1.1" 200 53 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" "-"
2022/06/14 02:35:11 [error] 27#27: *60 connect() failed (113: No route to host) while connecting to upstream, client: 10.89.0.80, server: _, request: "GET /api/settings HTTP/1.1", upstream: "http://10.89.0.15:8000/api/settings", host: "AA.BB.CC.DD:PORT"
2022/06/14 02:35:11 [warn] 27#27: *60 upstream server temporarily disabled while connecting to upstream, client: 10.89.0.80, server: _, request: "GET /api/settings HTTP/1.1", upstream: "http://10.89.0.15:8000/api/settings", host: "AA.BB.CC.DD:PORT"
2022/06/14 02:35:14 [error] 27#27: *60 connect() failed (113: No route to host) while connecting to upstream, client: 10.89.0.80, server: _, request: "GET /api/settings HTTP/1.1", upstream: "http://10.89.0.15:8000/api/settings", host: "AA.BB.CC.DD:PORT"
2022/06/14 02:35:14 [warn] 27#27: *60 upstream server temporarily disabled while connecting to upstream, client: 10.89.0.80, server: _, request: "GET /api/settings HTTP/1.1", upstream: "http://10.89.0.15:8000/api/settings", host: "AA.BB.CC.DD:PORT"
10.89.0.80 - - [14/Jun/2022:02:35:14 +0000] "GET /api/settings HTTP/1.1" 200 53 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" "-"
10.89.0.80 - - [14/Jun/2022:02:35:23 +0000] "GET /api/settings HTTP/1.1" 200 53 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" "-"
10.89.0.80 - - [14/Jun/2022:02:35:24 +0000] "GET /api/settings HTTP/1.1" 200 53 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" "-"
nginx is configured to use the resolver settings from /etc/resolv.conf and resolver looks like this:
resolver 10.89.0.1 valid=30s ipv6=off;
Edit: result from dig, with two ips:
; <<>> DiG 9.16.27-Debian <<>> backend
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24774
;; flags: qr rd ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 4a3030cc69feafb5 (echoed)
;; QUESTION SECTION:
;backend. IN A
;; ANSWER SECTION:
backend. 86400 IN A 10.89.0.15
backend. 86400 IN A 10.89.0.79
;; Query time: 0 msec
;; SERVER: 10.89.0.1#53(10.89.0.1)
;; WHEN: Tue Jun 14 02:43:29 UTC 2022
;; MSG SIZE rcvd: 80
I think I ended up in a situation where an old dns record was not removed up, causing nginx resolver to fail occasionally, in case anyone else ends up in a similar situation.
Will open an issue if I can repro this consistently.
Definitely seeing this. I'm working with a pretty basic Nginx reverse proxy + standalone apps on CentOS Stream 9. Structurally similar to a few Docker compose apps and a FreeBSD jail setup, and I've never seen anything even vaguely like this. podman network reload sometimes helps some hostnames resolve properly, but it's doing weird stuff like resolving internal container names to my external IP address (!).
This is on top of all sorts of other weird problems like port forwarding breaking if you attach a container to two networks, which makes me think podman networks are just broken. When I have some time I'm going to reproduce this issue in a VM and reopen this.
If you encounter this issue while using aardvark-dns, it can be caused by containers/aardvark-dns#203, fixed in aardvark-dns 1.2.0.
/kind bug
Description
Steps to reproduce the issue:
create two containers in the same network, at least one of them is nginx
check DNS name resolver in the containers
use the checked resolver IP address and DNS names in "resolver" and "set" option in nginx.conf for proxy_pass
Describe the results you received: DNS works, I can use commands like ping, getent, nslookup, dig. Everything looks ok, still nginx fails with error:
Describe the results you expected: it should work, as it works with docker, where resolver is 127.11
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
I use docker-compose with podman uds
I use external network to be able to provide the gateway (DNS) info for the containers:
Everything looks fine for me... but...
I have no idea what's the difference between my tests and nginx method to use DNS resolver. Maybe it's not a podman issue, but it works with docker. Teh anv var DNS_SUFFIX is empty for docker, also GATEWAY is 127.11