Letsencryptの”certbot renew”で、Pythonの実行時例外が発生し失敗する
Contents
問題事象
発生日: 2022年10月11日
Let’s encryptの”certbot renew” で、下に示すようなpythonの実行時例外が発生して、
更新に失敗する。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 570, in _build_master ws.require(__requires__) File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 888, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 779, in resolve raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.ContextualVersionConflict: (idna 3.3 (/usr/lib/python3.6/site-packages), Requirement.parse('idna<2.8,>=2.5'), {'requests'}) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/bin/certbot", line 6, in <module> from pkg_resources import load_entry_point File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3095, in <module> @_call_aside File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3079, in _call_aside f(*args, **kwargs) File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 572, in _build_master return cls._build_from_requirements(__requires__) File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 585, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 774, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'idna<2.8,>=2.5' distribution was not found and is required by requests |
この時の環境は、次の通り。
1. certbot-1.22.0-1.el8.noarch
2. Python 3.6.8
3. pip 9.0.3
4. RHEL 8.6
解決、または対処方法
解決方法
解決日: 2022年10月18日
cerbot、Python 3.6の更新を行ってみた。
もともと最新版になっていたようで、例外発生時と状況は変わらず。
次のコマンド実行が効いたようです。
1 2 3 4 5 6 7 |
[root@hoge-inet hoge]# pip3 install --upgrade pip [root@hoge-inet hoge]# pip3 --version WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. pip 21.3.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6) |
pip ? のバージョンが、”9.0.3”から”21.3.1”に更新されたようです。
正直、何がなんだか、よくわかりません。
なんで効果があったのかよくわかりませんので
その時の実行ログを下に添付します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
[root@hoge-inet iga]# yum remove certbot [root@hoge-inet iga]# yum install python36 python36-pip サブスクリプション管理リポジトリーを更新しています。 メタデータの期限切れの最終確認: 1:27:48 時間前の 2022年10月18日 07時47分19秒 に実施しました。 パッケージ python36-3.6.8-38.module+el8.5.0+12207+5c5719bc.x86_64 は既にインストールされています。 一致した引数がありません: python36-pip エラー: 一致するものが見つかりません: python36-pip [root@hoge-inet iga]# python3 --version Python 3.6.8 [root@hoge-inet iga]# pip3 --version pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6) [root@hoge-inet iga]# pip3 install --upgrade pip WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead. Collecting pip Downloading https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB) 100% |????????????????????????????????| 1.7MB 1.0MB/s Installing collected packages: pip Successfully installed pip-21.3.1 [root@hoge-inet iga]# pip --version pip 21.3.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6) [root@hoge-inet iga]# pip install certbot Requirement already satisfied: certbot in /usr/lib/python3.6/site-packages (1.22.0) Requirement already satisfied: acme>=1.22.0 in /usr/lib/python3.6/site-packages (from certbot) (1.22.0) Requirement already satisfied: ConfigArgParse>=0.9.3 in /usr/lib/python3.6/site-packages (from certbot) (0.14.0) Requirement already satisfied: configobj>=5.0.6 in /usr/lib/python3.6/site-packages (from certbot) (5.0.6) Requirement already satisfied: cryptography>=2.5.0 in /usr/lib64/python3.6/site-packages (from certbot) (3.2.1) Requirement already satisfied: distro>=1.0.1 in /usr/lib/python3.6/site-packages (from certbot) (1.4.0) Requirement already satisfied: josepy>=1.9.0 in /usr/lib/python3.6/site-packages (from certbot) (1.9.0) Requirement already satisfied: parsedatetime>=2.4 in /usr/lib/python3.6/site-packages (from certbot) (2.5) Requirement already satisfied: pyrfc3339 in /usr/lib/python3.6/site-packages (from certbot) (1.1) Requirement already satisfied: pytz in /usr/lib/python3.6/site-packages (from certbot) (2017.2) Requirement already satisfied: setuptools>=39.0.1 in /usr/lib/python3.6/site-packages (from certbot) (39.2.0) Requirement already satisfied: zope.component in /usr/lib/python3.6/site-packages (from certbot) (4.3.0) Requirement already satisfied: zope.interface in /usr/lib64/python3.6/site-packages (from certbot) (4.6.0) Requirement already satisfied: PyOpenSSL>=17.3.0 in /usr/lib/python3.6/site-packages (from acme>=1.22.0->certbot) (19.0.0) Requirement already satisfied: requests>=2.14.2 in /usr/lib/python3.6/site-packages (from acme>=1.22.0->certbot) (2.20.0) Requirement already satisfied: requests-toolbelt>=0.3.0 in /usr/lib/python3.6/site-packages (from acme>=1.22.0->certbot) (0.9.1) Requirement already satisfied: six>=1.4.1 in /usr/lib/python3.6/site-packages (from cryptography>=2.5.0->certbot) (1.11.0) Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/lib64/python3.6/site-packages (from cryptography>=2.5.0->certbot) (1.15.1) Requirement already satisfied: zope.event in /usr/lib/python3.6/site-packages (from zope.component->certbot) (4.2.0) Requirement already satisfied: pycparser in /usr/lib/python3.6/site-packages (from cffi!=1.11.3,>=1.8->cryptography>=2.5.0->certbot) (2.21) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3.6/site-packages (from requests>=2.14.2->acme>=1.22.0->certbot) (3.0.4) Collecting idna<2.8,>=2.5 Downloading idna-2.7-py2.py3-none-any.whl (58 kB) |????????????????????????????????| 58 kB 2.0 MB/s Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests>=2.14.2->acme>=1.22.0->certbot) (1.24.2) Installing collected packages: idna Attempting uninstall: idna Found existing installation: idna 3.3 Uninstalling idna-3.3: Successfully uninstalled idna-3.3 Successfully installed idna-2.7 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv [root@hoge-inet iga]# dnf install certbot [root@hoge-inet iga]# certbot renew Saving debug log to /var/log/letsencrypt/letsencrypt.log - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Processing /etc/letsencrypt/renewal/hoge.blog.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Renewing an existing certificate for hoge.blog - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations, all renewals succeeded: /etc/letsencrypt/live/hoge.blog/fullchain.pem (success) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
以上
ディスカッション
コメント一覧
まだ、コメントがありません