Letsencrypt 인증서 갱신 실패

Let’s Encrypt 인증서가 갱신되지 않은 것을 본 지 몇 년이 된 것 같은데, 지난 1~2주 사이에 만료된 인증서가 있는 사이트가 세 곳이나 있었습니다. 재구축을 하면 해결되지만, 그동안 로그에서 단서를 찾는 노력을 하지 않았습니다.

다음에는 문제를 해결하기 전에 조금 더 진단을 해보겠습니다.

다음 링크를 참조하세요:

감사합니다, 다니엘라! 그것이 관련이 있을 수도 있지만, 어떻게 해야 하는지, 또는 사이트가 새 인증서를 발급받도록 강제해야 하는지 어떻게 알 수 있는지 판단이 어렵습니다. 방금 몇 개 사이트를 확인해 봤는데, 여러 사이트가 지난 며칠 동안 인증서를 갱신했더군요. 모든 경우에서 인증서가 만료되었을 것이라고 생각하지만(방금 수정한 사이트 하나만 다시 확인했습니다), 더 생각할수록 이것이 문제를 설명해 주는 것 같지 않아요—그렇지 않으면, 몇몇 사이트가 너무 오래된 기본 이미지를 사용해서, 해당 기본 이미지에 오래된 루트 인증서가 포함되어 있어 새 인증서를 가져오는 데 실패한 경우라면 이야기가 달라지겠죠?

아! 그것이 설명이 될 수도 있겠네요. 제가 관리하는 또 다른 Docker 기반의 Debian 9 사이트가 루트 이미지가 잘못되어 있어 curl을 사용할 때 오류가 발생하고 있습니다.

해당 사이트들의 Discourse 기본 이미지는 얼마나 오래된 것인가요? 정확한 이미지 태그를 공유해 주세요.

방금 업그레이드한 사이트의 이미지 목록입니다 (./launcher cleanup 실행할 때인 것 같네요!). 그래서 2.0.20210528-1735였나요?


REPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE
local_discourse/app             latest              dab985be22b0        17 minutes ago      2.84GB
discourse/base                  2.0.20210528-1735   482386bf57af        4 months ago        2.36GB
<none>                          <none>              38be7702e0fc        5 months ago        2.75GB
discourse/base                  2.0.20210415-1332   30e4746e631e        5 months ago        2.23GB
discourse/base                  2.0.20201221-2020   c0704d4ce2b4        9 months ago        2.11GB
discourse/base                  2.0.20201004-2310   b64c37d7ab06        12 months ago       2.4GB
discourse/base                  2.0.20200429-2110   dc919e1dae2c        17 months ago       2.13GB
local_discourse/mail-receiver   latest              711fb527de35        21 months ago       128MB
discourse/base                  2.0.20191219-2109   4a99baef7044        21 months ago       2.23GB
discourse/mail-receiver         release             06fe375fe2c8        22 months ago       128MB
discourse/base                  2.0.20190901-2315   10f636afbeaf        2 years ago         2.29GB
discourse/base                  2.0.20190625-0946   2b3a5b47565f        2 years ago         1.93GB
discourse/base                  2.0.20190505-2322   ed87227f60d2        2 years ago         1.91GB
discourse/base                  2.0.20190321-0122   7db99586b5b5        2 years ago         1.97GB
discourse/mail-receiver         1.1.2               44042627246b        4 years ago         142MB

마지막 인증서의 정보입니다:

Issued On	Saturday, June 26, 2021 at 7:31:09 PM
Expires On	Friday, September 24, 2021 at 7:31:08 PM

다만 모든 사이트나 많은 사이트에서 발생한 것 같지는 않습니다.

맞습니다. 이번이 세 번째 일어난 일인데, 매번 사이트 복구에만 우선순위를 두었습니다. 다음에는 더 자세한 메모를 남기도록 하겠습니다.

로그에서 acme.sh 호출은 확인되지만, 출력은 /dev/null로 향하고 있습니다.

아, 여기서 정보가 유실된 것이군요. 이전 local_discourse/app의 상위 레이어 소스가 무엇이었는지 알아야 합니다.

최신 이미지로 테스트 사이트를 하나 운영 중인데, 인증서는 지난주에 정상적으로 갱신되었습니다.

네. 그리고 다른 사이트 여섯 개 정도도 확인해 봤는데, 전부 정상입니다.

아마 #mystery 태그를 달았어야 했나 봅니다.

저도 같은 문제를 겪고 있습니다. 재빌드(Rebuild)는 했는데, Discourse의 Let’s Encrypt 인증서가 갱신되지 않습니다.
설정을 어떻게 확인하면 될까요?

재구축 및 대기 문제 해결됨

아하! ZeroSSL을 기본 CA로 사용하는 것과 관련된 그 오류였군요. 최근까지도 문제가 되던 것이었으니 기억이 납니다.

아직 다시 빌드하지 않은 컨테이너가 하나 있습니다:

root@community:~# docker ps
CONTAINER ID   IMAGE                           COMMAND        CREATED        STATUS      PORTS                                      NAMES
9b97fe9b5c22   local_discourse/web_only        "/sbin/boot"   9 months ago   Up 5 days   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   web_only
b3eae8a90cd7   local_discourse/mail-receiver   "/sbin/boot"   9 months ago   Up 5 days   0.0.0.0:25->25/tcp                         mail-receiver
5e90805e6d0d   local_discourse/data            "/sbin/boot"   9 months ago   Up 5 days                                              data
root@community:~# docker images
REPOSITORY                      TAG                 IMAGE ID       CREATED         SIZE
local_discourse/web_only        latest              ffd890f053e7   9 months ago    2.39GB
local_discourse/mail-receiver   latest              0d49c641ca25   9 months ago    128MB
<none>                          <none>              e53ed7c5db0f   9 months ago    2.34GB
local_discourse/data            latest              8c1539b06db4   9 months ago    2.15GB
discourse/base                  2.0.20201221-2020   c0704d4ce2b4   9 months ago    2.11GB
discourse/base                  2.0.20201208-1739   9da970f9c0bd   9 months ago    2.1GB
discourse/mail-receiver         release             06fe375fe2c8   22 months ago   128MB

컨테이너에서 acme 명령을 실행하면 다음과 같은 결과가 나옵니다:

root@community-web-only:/# "/shared/letsencrypt"/acme.sh --cron --home "/shared/letsencrypt" 
[Mon 04 Oct 2021 02:01:39 PM UTC] ===Starting cron===
[Mon 04 Oct 2021 02:01:39 PM UTC] Already uptodate!
[Mon 04 Oct 2021 02:01:39 PM UTC] Upgrade success!
[Mon 04 Oct 2021 02:01:39 PM UTC] Auto upgraded to: 3.0.1
[Mon 04 Oct 2021 02:01:39 PM UTC] Renew: 'community.thedaily9.in'
[Mon 04 Oct 2021 02:01:41 PM UTC] Using CA: https://acme.zerossl.com/v2/DV90
[Mon 04 Oct 2021 02:01:41 PM UTC] No EAB credentials found for ZeroSSL, let's get one
[Mon 04 Oct 2021 02:01:41 PM UTC] acme.sh is using ZeroSSL as default CA now.
[Mon 04 Oct 2021 02:01:41 PM UTC] Please update your account with an email address first.
[Mon 04 Oct 2021 02:01:41 PM UTC] acme.sh --register-account -m my@example.com
[Mon 04 Oct 2021 02:01:41 PM UTC] See: https://github.com/acmesh-official/acme.sh/wiki/ZeroSSL.com-CA
[Mon 04 Oct 2021 02:01:41 PM UTC] Please check log file for more details: /shared/letsencrypt/acme.sh.log
[Mon 04 Oct 2021 02:01:41 PM UTC] Error renew community.thedaily9.in.
[Mon 04 Oct 2021 02:01:41 PM UTC] Renew: 'community.thedaily9.in'
[Mon 04 Oct 2021 02:01:43 PM UTC] Using CA: https://acme.zerossl.com/v2/DV90
[Mon 04 Oct 2021 02:01:43 PM UTC] No EAB credentials found for ZeroSSL, let's get one
[Mon 04 Oct 2021 02:01:43 PM UTC] acme.sh is using ZeroSSL as default CA now.
[Mon 04 Oct 2021 02:01:43 PM UTC] Please update your account with an email address first.
[Mon 04 Oct 2021 02:01:43 PM UTC] acme.sh --register-account -m my@example.com
[Mon 04 Oct 2021 02:01:43 PM UTC] See: https://github.com/acmesh-official/acme.sh/wiki/ZeroSSL.com-CA
[Mon 04 Oct 2021 02:01:43 PM UTC] Please check log file for more details: /shared/letsencrypt/acme.sh.log
[Mon 04 Oct 2021 02:01:43 PM UTC] Error renew community.thedaily9.in_ecc.
[Mon 04 Oct 2021 02:01:43 PM UTC] ===End cron===
root@community-web-only:/# 

이 커밋이 문제를 해결할 것이라고 생각합니다. 그리고 이 문제가 발생한 사이트들은 이 커밋 이전의 것일 가능성이 높습니다.