LoginSignup
1
0

More than 3 years have passed since last update.

Amazone linux にwgetでinstallしたcertbot-auto が動かなくなったときの対応(2019年版)

Last updated at Posted at 2019-06-07

この記事は下記記事をもとに、2019年版を作成させて頂きました。感謝。
https://qiita.com/hogehoge-banana/items/0f8285c5dcccab3f11bc

なにがおきたの?

Amazone linux にwgetでinstallしたcertbot-auto が、SSL証明書発行時に走るアップデートで、以下のエラーが発生しました。

# certbot-auto certonly --webroot -w /srv/letsencrypt/example.com/ -d example.com -m info@example.com --agree-tos
Upgrading certbot-auto 0.34.2 to 0.35.0...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 7, in <module>
    from certbot.main import main
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/main.py", line 10, in <module>
    import josepy as jose
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/__init__.py", line 44, in <module>
    from josepy.interfaces import JSONDeSerializable
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/interfaces.py", line 8, in <module>
    from josepy import errors, util
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/util.py", line 4, in <module>
    import OpenSSL
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/crypto.py", line 12, in <module>
    from cryptography import x509
ImportError: No module named cryptography

要約

cryptographyも必要だけど、pip install cryptographyでインストールできなかったため、
pipでcertbotインストールする。

環境

$ cat /etc/system-release
Amazon Linux AMI release 2018.03

wgetで /usr/bin/certbot-auto をインストールしてました

やったこと

# rm -rf /opt/eff.org/*
# pip install -U certbot
# certbot renew --debug

https://github.com/certbot/certbot/issues/1680#issuecomment-358728515
上記より引用

certbot-autoコマンドはエラーのままなので、削除しておく。
このcertbotコマンドは、Amazone linux特有の --debug フラグすら不要で動作しました。ここらへんの動きはわからず。もし判る方いらっしゃったら、教えてくれると嬉しい限りです。

[補足] pip install cryptographyでインストールできなかった

# python -V
Python 2.7.16

# which pip
/usr/bin/pip

# pip install cryptography
Requirement already satisfied: cryptography in /usr/local/lib64/python2.7/site-packages
Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/local/lib64/python2.7/site-packages (from cryptography)
Requirement already satisfied: six>=1.4.1 in /usr/local/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied: ipaddress; python_version < "3" in /usr/local/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/local/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied: enum34; python_version < "3" in /usr/local/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied: pycparser in /usr/local/lib/python2.7/site-packages (from cffi!=1.11.3,>=1.8->cryptography)
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0