업그레이드 후 Docker가 외부와 통신하지 못합니다

오늘 아침에 discourse 서버가 "다운"이라는 보고를 받았습니다.

서버에 ssh로 접속하는 데는 문제가 없었고, 몇 가지 보안 업데이트가 필요하다는 것을 알아차려 apt full-upgrade로 적용한 후 reboot로 서버를 재시작했습니다.

다시 기동하는 데 시간이 좀 걸렸지만, 기동된 후 discourse docker 컨테이너가 실행 중인지 확인해 보니 이상하게도 문제가 없었습니다.

./launcher app stop와 ./launcher app start로 정지 후 재시작을 시도해 봤지만, 해결되지 않았습니다.

./launcher app rebuild를 실행해 보니 다음과 같은 오류가 발생했습니다.

fatal: unable to access 'https://github.com/discourse/pups.git/': Could not resolve host: github.com
d1412324832190f43a2d51b5f10c53d6fa671056f91d0be2178d17a5ba1ab692

정확한 원인 파악을 위한 충분한 정보는 아니지만, 막막한 상황입니다. 조언을 주시면 감사하겠습니다.

감사합니다

이는 네트워크 오류가 있음을 시사합니다. 도커가 외부 네트워크에 접근할 수 없는 것일까요?

어떻게 확인해 볼 수 있을까요? 의견이 있으신가요?

다음과 같이 시도해 보세요:

docker run --rm -i debian ping -c 1 github.com

예를 들어 다음과 같은 출력을 받아야 합니다:

○ → docker run --rm -i debian ping -c 1 github.com
PING github.com (140.82.113.3) 56(84) bytes of data.
64 bytes from lb-140-82-113-3-iad.github.com (140.82.113.3): icmp_seq=1 ttl=49 time=44.8 ms

--- github.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 44.797/44.797/44.797/0.000 ms

네 .. 이 명령어는
ping: github.com: Temporary failure in name resolution
이 반환됩니다.

무엇이 변경되었는지 모르겠습니다. 이 문제를 어떻게 수정해야 할지 전혀 감이 잡히지 않습니다.

Docker 외부에서도 작동하나요?

Docker 외부에서 github에 접근할 수 있습니다.

ping github.com
PING github.com (192.30.255.113) 56(84) bytes of data.
64 bytes from lb-192-30-255-113-sea.github.com (192.30.255.113): icmp_seq=1 ttl=52 time=23.3 ms
64 bytes from lb-192-30-255-113-sea.github.com (192.30.255.113): icmp_seq=2 ttl=52 time=23.3 ms

다음과 같이 시도해 보세요:

  • docker 재시작
  • docker run --rm -i debian cat /etc/resolv.conf를 실행하여 파일에 무엇이 있는지 확인

구글처럼 보입니다

# 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
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 8.8.8.8
nameserver 8.8.4.4

@supermathie 이게 관련이 있는지 확실하지는 않지만 ./launcher logs app에서 다음 내용을 확인했습니다

[Tue 01 Dec 2020 07:07:13 PM UTC] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 6
[Tue 01 Dec 2020 07:07:13 PM UTC] Can not init api.
[Tue 01 Dec 2020 07:07:13 PM UTC] Domains not changed.
[Tue 01 Dec 2020 07:07:13 PM UTC] Skip, Next renewal time is: Sat Dec 26 00:31:17 UTC 2020
[Tue 01 Dec 2020 07:07:13 PM UTC] Add '--force' to force to renew.
[Tue 01 Dec 2020 07:07:13 PM UTC] Installing key to:/shared/ssl/community.acescentral.com.key
[Tue 01 Dec 2020 07:07:13 PM UTC] Installing full chain to:/shared/ssl/community.acescentral.com.cer
[Tue 01 Dec 2020 07:07:13 PM UTC] Run reload cmd: sv reload nginx
fail: nginx: runsv not running
[Tue 01 Dec 2020 07:07:13 PM UTC] Reload error for :
[Tue 01 Dec 2020 07:07:33 PM UTC] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 6
[Tue 01 Dec 2020 07:07:34 PM UTC] Can not init api.
[Tue 01 Dec 2020 07:07:34 PM UTC] Domains not changed.
[Tue 01 Dec 2020 07:07:34 PM UTC] Skip, Next renewal time is: Sat Dec 26 00:31:20 UTC 2020
[Tue 01 Dec 2020 07:07:34 PM UTC] Add '--force' to force to renew.
[Tue 01 Dec 2020 07:07:34 PM UTC] Installing key to:/shared/ssl/community.acescentral.com_ecc.key
[Tue 01 Dec 2020 07:07:34 PM UTC] Installing full chain to:/shared/ssl/community.acescentral.com_ecc.cer
[Tue 01 Dec 2020 07:07:34 PM UTC] Run reload cmd: sv reload nginx
fail: nginx: runsv not running
[Tue 01 Dec 2020 07:07:34 PM UTC] Reload error for :
Started runsvdir, PID is 458
chgrp: invalid group: ‘syslog’
ok: run: redis: (pid 473) 0s
ok: run: postgres: (pid 470) 0s
rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
rsyslogd: activation of module imklog failed [v8.1901.0 try https://www.rsyslog.com/e/2145 ]
supervisor pid: 471 unicorn pid: 497

사용 중인 Docker 버전은 무엇이며, 어떻게 설치하셨나요? 그리고 어떤 Ubuntu 버전을 사용 중이신가요?

Client:
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.13.8
 Git commit:        afacb8b7f0
 Built:             Wed Oct 14 19:43:43 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.8
  Git commit:       afacb8b7f0
  Built:            Wed Oct 14 16:41:21 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.3-0ubuntu2.1
  GitCommit:
 runc:
  Version:          spec: 1.0.1-dev
  GitCommit:
 docker-init:
  Version:          0.18.0
  GitCommit:

솔직히 기억이 나지 않습니다 .. 처음부터 여기 있었습니다. 오늘 아침에 위에서 설명한 대로 Ubuntu를 업데이트했습니다.

Ubuntu 20.04.1 LTS

Docker를 재시작한 후, ping 명령어가 작동하나요?

아니요, 동일한 오류가 발생합니다.

ping: github.com: Temporary failure in name resolution

또 다른 무작위적인 점이지만 …

내 디스커스 서버는 community.mydomain.com에 있습니다.
워드프레스 서버는 mydomain.com에 있습니다.
어제는 chat.mydomain.com에 로켓채트(RocketChat) 서버를 설정했습니다.

chat.mydomain.com을 Let’s Encrypt로 등록했습니다.
워드프레스와 로켓채트 서버는 모두 정상적으로 작동하고 있습니다.

이 문제와 관련이 있을지 확실하지는 않지만, 혹시 놓치고 있는 것이 없는지 확인하고 싶었습니다.

docker를 정리하고 다시 설치해 볼 수도 있습니다. 여기서 정확히 어떤 일이 일어나고 있고 docker가 왜 깨졌는지는 추측하기 어렵습니다.

무엇을 하기 전에, 데이터의 백업( Discourse 백업 또는 최소한 postgres 및 uploads)이 있는지 확인하십시오. 가능하다면 VM의 이미지를 만들어 두세요.

docker를 완전히 삭제하고 다시 설치했습니다.

문제는 여전히 지속됩니다.

정말 답답합니다.

서버에서 Google DNS, 즉 ping 8.8.8.8에 도달할 수 있나요?

서버에서는 문제가 없습니다

ping -c 1 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=2.72 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.720/2.720/2.720/0.000 ms

Docker에서는 작동하지 않습니다

docker run --rm -i debian ping -c 1 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

솔직히 말해서, 지금 상황에서 가장 좋은 방법은 재설치 후 데이터를 복사하는 것입니다.

알 수 없는 이유로 시스템이 손상된 상태이며, 설치 과정은 비교적 빠릅니다. 시간을 가장 효율적으로 사용하는 방법일 가능성이 높습니다.