网站一直使用letsencrypt
提供的HTTPS
证书,这个证书的问题在于每隔三个月就必须更新一次,本次更新证书的时候,提示如下错误:
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 |
Error: couldn't get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt: Traceback (most recent call last): File "/root/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module> from certbot.main import main File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 9, in <module> from acme import jose File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/__init__.py", line 37, in <module> from acme.jose.interfaces import JSONDeSerializable File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/interfaces.py", line 9, in <module> from acme.jose import util File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/util.py", line 4, in <module> from cryptography.hazmat.primitives.asymmetric import rsa File "/root/.local/share/letsencrypt/local/lib/python2.7/site- packages/cryptography/hazmat/primitives/asymmetric/rsa.py", line 14, in <module> from cryptography.hazmat.backends.interfaces import RSABackend File "/root/.local/share/letsencrypt/local/lib/python2.7/site- packages/cryptography/hazmat/backends/__init__.py", line 7, in <module> import pkg_resources File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 36, in <module> import plistlib File "/usr/lib/python2.7/plistlib.py", line 62, in <module> import datetime ImportError: No module named datetime |
错误发生的原因在于letsencrypt
自己构建了一个Python
的虚拟环境来隔离,但是早期建立的虚拟环境中是缺少部分软件包的,而自身的BUG
导致也没有重新更新虚拟环境,导致出现异常。
解决方法就是删除letsencrypt
自己构建的Python
的虚拟环境,然后继续执行脚本让他重建即可。
1 |
$ rm -rf ~/.local/share/letsencrypt |
涉猎好广泛啊,这个不会是你自己的网站吧,找到一些对我有用的东西,mark