Let's Encrypt証明書の更新失敗

Let’s Encrypt の証明書が更新に失敗したのを見たのは何年ぶりかと思いますが、過去 1〜2 週間で 3 つのサイトが期限切れの証明書を抱えていました。再構築で解決しますが、これまでログに手がかりがないか確認することを怠っていました。

次回からは、サイトを修復する前に、もう少し問題の診断に努めます。

「いいね!」 2

以下のページをご覧ください:

「いいね!」 3

ありがとうございます、ダニエラ!確かにそれに関連している可能性はありますが、どう対処すればよいか、あるいはどのサイトが新しい証明書の取得を強制すべきかを判断する方法がわかりません。いくつかのサイトを調べてみると、過去数日間に更新されたものが複数ありました。すべてのケースで証明書が期限切れになっていたと信じています(私が直した一つだけ確認しました)。そのため、考えるほどに、これが原因ではないように思えてきます。— unless、これらのサイトの一部が、古いベースイメージを使用していて、そのベースイメージに古いルート証明書が含まれていたため、新しい証明書の取得に失敗していたのかもしれません?

ああ、それなら説明がつきますね。私が管理している別の Docker ベースの Debian 9 サイトでも、curl を使用するとエラーが発生しています。その原因は、ベースイメージが不適切なためです。

「いいね!」 2

それらのサイトで使用されている Discourse ベースイメージのバージョンは何ですか?正確なイメージタグを共有してください。

「いいね!」 1

サイトからアップグレード直後の画像リストです(./launcher cleanup のタイミングのようです)。つまり、バージョンは 2.0.20210528-1735 だったのでしょうか?


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

直近の証明書に関する情報は以下の通りです:

発行日:2021 年 6 月 26 日(土)19:31:09
有効期限:2021 年 9 月 24 日(金)19:31:08

ただし、これはすべてのサイト、あるいは多くのサイトには当てはまらないようです。

その通りです。これが 3 度目の発生で、そのたびにサイトの復旧を最優先してきました。次回からはより丁寧なメモを残すようにします。

ログには acme.sh の呼び出しは確認できますが、出力は /dev/null に捨てられています。

「いいね!」 1

ああ、つまりこの情報が失われているのですね。古い local_discourse/app の親レイヤーのソースが何であったかを知る必要があります。

私は最新のイメージを使用したテストサイトを持っており、証明書は先週正常に更新されました。

「いいね!」 2

ええ。そして、他の数件も確認しましたが、すべて問題ありません。
これは #mystery とタグ付けすべきでしたね。

「いいね!」 1

私も同じ問題に直面しています。再ビルドは行いましたが、Discourse の Let’s Encrypt 証明書が更新されません。インストール状況を確認するにはどうすればよいでしょうか?

「いいね!」 1

再構築と待機が解決しました

「いいね!」 2

ああ、なるほど!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:/# 
「いいね!」 2

このコミットで問題が解決すると思います。この問題を抱えているサイトは、おそらくこのコミットより前のバージョンです。

「いいね!」 1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.