Repository navigation
Description
Bug Report
Concourse version: 3.9.2
Deployment type: binary, systemd
Infrastructure: single on-premise machine, Ubuntu 16.04
I just set up this new Concourse installation a couple days ago. I've got a job with git and docker-image resources, and DNS isn't working inside either of them.
I know the jobs are properly configured because I can use an HTTP proxy as a workaround for the git resource:
https_tunnel:
proxy_host: 192.168.0.29
proxy_port: 1081
But I wasn't able to get the docker image resource to work by setting the proxy in the concourse worker; perhaps this PR (which fixes this issue) isn't in yet, or maybe this issue means that it's still not fixed.
Let's hijack a build container
If I hijack a build container and start poking around, /etc/resolv.conf is empty:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
So manually resolving DNS looks like this:
# nslookup www.baidu.com
nslookup: can't resolve '(null)': Name does not resolve
nslookup: can't resolve 'www.baidu.com': Try again(I'm using baidu because I'm in China and Google is blocked) But even if I manually specify the DNS server (in this case, Baidu's equivalent of 8.8.8.8), name resolution fails:
nslookup www.baidu.com 114.114.114.114
Server: 114.114.114.114
Address 1: 114.114.114.114
nslookup: can't resolve 'www.baidu.com': Try againWhereas on the host box itself, name resolution works just fine:
$ nslookup www.baidu.com 114.114.114.114
Server: 114.114.114.114
Address: 114.114.114.114#53
Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 119.75.213.61
Name: www.a.shifen.com
Address: 119.75.216.20This looks like a UDP forwarding issue, so I ran these commands:
sudo ufw disable
sudo iptables -I FORWARD -j ACCEPTAs well as re-enabling UFW and setting its default forward policy to ACCEPT as described here, but that didn't help.
TCP and ICMP forwarding works just fine though; if I know the IP address of a web server (like www.baidu.com), I can ping it and get a web page from it:
$ ping 119.75.216.20
PING 119.75.216.20 (119.75.216.20): 56 data bytes
64 bytes from 119.75.216.20: seq=0 ttl=54 time=2.947 ms
64 bytes from 119.75.216.20: seq=1 ttl=54 time=2.788 ms
...
$ curl http://119.75.216.20/
<!DOCTYPE html>
<!--STATUS OK--><html> <head><meta http-equiv ...Since it's a UDP forwarding issue and not a DNS issue, none of the Gardner DNS settings help at all.
TL;DR
It looks like UDP forwarding to containers is somehow not setup properly by gardener. In this issue someone mentions using socat to set up forwarding, but that doesn't seem applicable since I'm not using docker.
Activity
nrvale0 commentedon Apr 7, 2018
I'm not suggesting this is the correct solution but I was at least able to get things going via:
kaiterramike commentedon Apr 9, 2018
That works!
iptables -I FORWARD ACCEPTisn't good enough apparently.wfranzini commentedon Apr 10, 2018
I've had the same problem and solved changing the policy for FORWARD.
Is it possible to track the origin of the problem and, if the culprit is not concourse, document it?
kaiterramike commentedon Apr 10, 2018
The output of
sudo iptables-saveis a solid 343 lines, so it's beyond my ability to dig through. Most of that is created by whatever's creating the container namespaces -- garden-runc, right?Edit: I'm pretty sure this is a duplicate of #1667
jama22 commentedon May 18, 2018
Closing since there seems to be a decent workaround, and linked to #1667 . Please feel free to re-open if I've misinterpreted!
bump etree tsa handlers mux clockwork goxmldsig genproto grpc