smebberson / docker-alpine

Docker containers running Alpine Linux and s6 for process management. Solid, reliable containers.
MIT License
596 stars 186 forks source link

consul cluster bootstrap not working in alpine-consul:3.1.1 #75

Open jousby opened 7 years ago

jousby commented 7 years ago

When spinning up the complete example in examples/complete the consul cluster fails to bootstrap with the latest build (3.1.1). If I change the version of alpine-consul back to the previous version 'alpine-consul:3.1.0' things appear to work.

It looks like the dns query is not working in the latest.

consul_1 | * Failed to resolve ;;: lookup ;;: invalid domain name consul_1 | 2017/01/19 19:40:11 [WARN] agent: Join failed: , retrying in 30s consul_1 | 2017/01/19 19:40:14 [ERR] agent: coordinate update error: No cluster leader consul_3 | 2017/01/19 19:40:17 [ERR] agent: failed to sync remote state: No cluster leader consul_2 | 2017/01/19 19:40:18 [ERR] agent: coordinate update error: No cluster leader consul_3 | 2017/01/19 19:40:23 [ERR] agent: coordinate update error: No cluster leader consul_2 | 2017/01/19 19:40:34 [ERR] agent: failed to sync remote state: No cluster leader consul_1 | 2017/01/19 19:40:41 [INFO] agent: (LAN) joining: [;;] consul_1 | 2017/01/19 19:40:41 [WARN] memberlist: Failed to resolve ;;: lookup ;;: invalid domain name consul_1 | 2017/01/19 19:40:41 [INFO] agent: (LAN) joined: 0 Err: 1 error(s) occurred:

Something else that looks suspect. In the logs for dnsmasq it looks like the service is being continually restarted.

/var/log/go-dnsmasq/go-dnsmasq.log

time="2017-01-19T19:38:42Z" level=info msg="Starting go-dnsmasq server 1.0.7" time="2017-01-19T19:38:42Z" level=info msg="Nameservers: [127.0.0.11:53]" time="2017-01-19T19:38:42Z" level=info msg="Setting host nameserver to 127.0.0.1" time="2017-01-19T19:38:42Z" level=info msg="Ready for queries on tcp://127.0.0.1:53" time="2017-01-19T19:38:42Z" level=info msg="Ready for queries on udp://127.0.0.1:53" time="2017-01-19T19:38:42Z" level=fatal msg="listen udp 127.0.0.1:53: bind: permission denied" time="2017-01-19T19:38:43Z" level=info msg="Starting go-dnsmasq server 1.0.7" time="2017-01-19T19:38:43Z" level=info msg="Nameservers: [127.0.0.11:53]" time="2017-01-19T19:38:43Z" level=info msg="Setting host nameserver to 127.0.0.1" time="2017-01-19T19:38:43Z" level=info msg="Ready for queries on tcp://127.0.0.1:53" time="2017-01-19T19:38:43Z" level=info msg="Ready for queries on udp://127.0.0.1:53" time="2017-01-19T19:38:43Z" level=fatal msg="listen udp 127.0.0.1:53: bind: permission denied"

smebberson commented 7 years ago

@jousby, I'll have a fix for this shortly. It is because of go-dnsmasq. In some environments setcap doesn't work. There is new capability to change the user that go-dnsmasq will run as through ENV variables.