Let’s Encryptの自動更新でエラーが出て更新できない
以前の記事で、Let’s Encryptの自動更新を設定しましたが、Let’s Encryptから期限が切れる旨のメールが来ました。
確認してみると更新されていないようでした。
とうやら、Cronは動いているが、更新処理に失敗しているようです。
個別に動かしてみると以下のようなエラーが出ていました。
[root@test]# service nginx stop←nginxの停止 [root@test]# /usr/local/bin/certbot-auto renew --force-renew --debug --nginx←更新 ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'virtualenv==15.1.0' distribution was not found and is required by the application
The ‘virtualenv==15.1.0’ distribution was not found and is required by the application
色々と試した結果、virtualenvがうまく見つかっていないようです。
そのため、virtualenv –version等のコマンドでも同様のエラーが出ます。
探していると、Pythonの入れ直しとか、色々な記事しか見つからず、なかなか手強かったのですが、
結果的には単純にvirtualenvの入れ直しで解決しました。
[root@test]# pip uninstall virtualenv←アンインストール [root@test]# pip install virtualenv←インストール