Users are experiencing issues with Docker containers failing to resolve github.com during Discourse app rebuilds, despite the host system being able to resolve it. The problem occurs after system updates and is linked to Docker’s DNS configuration and network connectivity. Several users report that using Google’s DNS (8.8.8.8 and 8.8.4.4) in /etc/default/docker does not resolve the issue. One user found that an OVH firewall was blocking traffic to these DNS servers, while others on Ubuntu 18.04 and CentOS 8 face similar problems due to network configuration changes, such as nftables on CentOS 8 or Docker’s default bridge network restrictions. Temporary workarounds include enabling promiscuous mode on docker0 or manually setting up masquerading rules in firewalld. The issue appears to stem from Docker’s inability to access the internet via the default bridge network, with the root cause varying by system configuration. grumps, imaBASKET, gekkonen, rcauvin, and paulraines68 discuss the problem and potential fixes.
We’re enjoying discourse thus far. I’m having an issue with running a rebuild of the docker container. The container won’t rebuild because for some reason it can’t resolve github.com. I know the host system (debian jessie) can resolve at that time via dig && ping. However if I issue a systemctl restart docker the issue goes away.
I turned to the goog or alphabet machine which suggested starting the docker daemon using the goog’s dns which I’ve done and confirmed that it seems to have taken via a systemctl status docker.
I’ve been able to reproduce on a debian droplet and a virtual box vm.
Also I’ve been able to successfully pull a Ubuntu image, and run the container.
I’m not sure if there’s something in launcher or any other suggestions? Working off of git master, and is up to date.
shortlist:
Debian Jessie Kernel 3.16
Docker version 1.6.2, build 7c8fca2
launch rebuild app
root@alpha:/var/discourse# ./launcher rebuild app
Ensuring discourse docker is up to date
Fetching origin
Discourse Docker is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 10 app
app
cd /pups && git pull && /pups/bin/pups --stdin
fatal: unable to access 'https://github.com/SamSaffron/pups.git/': Could not resolve host: github.com
210c421dbe03e0339d110f1eec9eb3c985b0a0d4e32709d569c9cd1f235a7964
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
systemctl status - shows --dns
root@alpha:/var/discourse# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled)
Active: active (running) since Thu 2015-08-13 03:42:17 UTC; 26min ago
Docs: http://docs.docker.com
Main PID: 22232 (docker)
CGroup: /system.slice/docker.service
└─22232 /usr/bin/docker -d -H fd:// --dns 8.8.8.8 --dns 8.8.4.4
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="+job wait(7d602b0addff82e7626b659c5e30131a11ab7f35034198983a19e2b8861111b5)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="-job wait(7d602b0addff82e7626b659c5e30131a11ab7f35034198983a19e2b88... = OK (0)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="DELETE /v1.18/containers/7d602b0addff82e7626b659c5e30131a11ab7f3503...8861111b5"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="+job rm(7d602b0addff82e7626b659c5e30131a11ab7f35034198983a19e2b8861111b5)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="+job log(destroy, 7d602b0addff82e7626b659c5e30131a11ab7f35034198983...e:1.0.12)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="-job log(destroy, 7d602b0addff82e7626b659c5e30131a11ab7f35034198983... = OK (0)"
Aug 13 04:03:40 alpha docker[22232]: time="2015-08-13T04:03:40Z" level=info msg="-job rm(7d602b0addff82e7626b659c5e30131a11ab7f35034198983a19e2b8861... = OK (0)"
Aug 13 04:04:15 alpha docker[22232]: time="2015-08-13T04:04:15Z" level=info msg="GET /v1.18/containers/json"
Aug 13 04:04:15 alpha docker[22232]: time="2015-08-13T04:04:15Z" level=info msg="+job containers()"
Aug 13 04:04:15 alpha docker[22232]: time="2015-08-13T04:04:15Z" level=info msg="-job containers() = OK (0)"
Hint: Some lines were ellipsized, use -l to show in full.
docker info
root@alpha:/var/discourse# docker info
Containers: 3
Images: 18
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 24
Dirperm1 Supported: true
Execution Driver: native-0.2
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
CPUs: 1
Total Memory: 2.879 GiB
Name: alpha
ID: WF4H:KABY:JPTX:RW2U:FWCT:PNKZ:DR2P:2ZFE:ZLUD:AB4R:D3CH:EXCA
WARNING: No memory limit support
WARNING: No swap limit support
Hi @sam thanks for taking the time to review.
I have that option uncommented in /etc/defaults/docker, and I’ve restarted the docker service many times.
To clarify, after restarting the docker service the laucher rebuild will work once, after that I have to restart the service.
Interestingly though, when I ping6 github.com I of course do not recieve a response because github does not have AAAA records i believe. Imgur: The magic of the Internet
This isn’t a Discourse problem, it’s a Docker problem. You’ll probably get more knowledgeable help at the Docker support forums (which, helpfully, also run Discourse).
I figured out the issue and solution to this problem at least for me.
The issue was that Docker uses 8.8.8.8 and 8.8.4.4 as its DNS and I had an OVH network based firewall blocking ALL IPv4 traffic that did not match port 80, 443, and a few other specific rules. I had to authorize IPv4 traffic for 8.8.8.8 and 8.8.4.4
최신 discourse git에서도 비슷한 문제를 겪고 있습니다. 시스템 업데이트와/또는 웹 UI를 통한 discourse 업데이트를 수행한 후부터 이 문제가 발생하기 시작했습니다. 이제 앱을 다시 빌드하려고 하면 다음과 같은 오류가 표시됩니다:
[root@forum /var/discourse]# ./launcher rebuild app
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 60 app
app
cd /pups && git pull && /pups/bin/pups --stdin
fatal: unable to access 'https://github.com/discourse/pups.git/': Could not resolve host: github.com
8f082ebcb977f9efafbdbff15ab69e8d06c0a7e2cb99410f85e1f90b03ae733b
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
github.com과 8.8.8.8에 ping을 보낼 수 있으며, /etc/default/docker 파일을 편집하여 DNS 옵션을 전환해 보았습니다: DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
CentOS 8에서 이 오류는 RHEL7용 Docker RPM 패키지(아직 RHEL8용 패키지는 없음)가 새로운 nftables 기반 방화벽을 지원하지 않기 때문에 발생합니다. docker0 인터페이스에 대해 마스커레이딩(masquerading)을 수동으로 설정해야 합니다.
이 해결책이 작동하는지 확인하고 싶습니다. 저는 Hetzner를 사용하는 CentOS 8을 사용 중입니다.
구체적으로 아래에 나열된 순서대로 다음 명령어를 실행했습니다. (출처) - @paulraines68님께 감사드립니다.
# Masquerading은 Docker의 수신 및 송신 트래픽을 허용합니다 (이 부분이 핵심입니다)
firewall-cmd --zone=public --add-masquerade --permanent
# 포트 80/443에 대한 수신 트래픽을 명시적으로 허용합니다 (새로운 내용은 아닙니다)
firewall-cmd --zone=public --add-port=80/tcp
firewall-cmd --zone=public --add-port=443/tcp
# 영구 규칙을 적용하기 위해 방화벽을 재로드합니다
firewall-cmd --reload