eu corri
./letsencrypt-auto --help --debug
instalar permite criptografar.
Todos os pacotes foram instalados com sucesso, mas ocorre o seguinte erro:
Criando ambiente virtual...
Atualizando dependências do letsencrypt e do ambiente virtual......Comando "/root/.local/share/letsencrypt/bin/python2.7 -c "import setuptools, tokenize; file ='/dev/shm/pip-build-OslHtf/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)( file ).read().replace('rn', ' n'), file , 'exec'))" install --record /tmp/pip-lx9pFX-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/ .local/share/letsencrypt/include/site/python2.7/cffi" falhou com o código de erro 1 em /dev/shm/pip-build-OslHtf/cffi
Qualquer ideia? Percebo que o suporte ao linux da Amazon é experimental e não pretendo usar todas as ferramentas de automação (ainda), mas seria ótimo se eu pudesse pelo menos obter certificados gerados manualmente.
De #1458 ,
Consegui executar o cliente com um letsencrypt-auto modificado no Amazon Linux 2015.03 instalando manualmente o pacote python27-virtualenv primeiro e depois executando o caminho de inicialização do RedHat.
Fiz isso e parece estar funcionando. Você precisa executar sudo yum install python27-virtualenv e sudo ./bootstrap/_rpm_common.sh
@barshinoff Estou curioso para saber se isso está relacionado ao # 1677 (um erro de falta de memória ao compilar dependências cffi em outras distribuições da família redhat) verifiquei se ./letsencrypt-auto funciona em instalações limpas do amazon linux 2015.09 .1 e 2015.03.1 em instâncias t2.micro sem mais nada em execução. Em que tipo de instância e AMI você está tentando isso? Se você executá-lo detalhadamente com '-v' ./letsencrypt-auto --help --debug -v ele pode fornecer mais informações sobre o que está acontecendo.
Oi, obrigado pelo conselho.
Não é um problema de memória, para ter certeza de que nada mais estava sendo executado e conectei uma unidade de troca de 40 GB.
Estou executando a distro 2015.09 com todos os pacotes atualizados.
Instalar o pacote python27-virtualenv primeiro e depois executar o caminho de inicialização do RedHat, conforme sugerido por @kiwimancy , me fez passar pelo erro inicial.
O erro que agora recebo é:
Updating letsencrypt and virtual environment dependencies.......
Running with virtualenv: /root/.local/share/letsencrypt/bin/letsencrypt
Traceback (most recent call last):
File "/root/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
from letsencrypt.cli import main
File "/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/letsencrypt/cli.py", line 17, in <module>
import OpenSSL
ImportError: No module named OpenSSL
Mesmo erro aqui no mesmo Amazon Linux 2015.09.
Abaixo está o log detalhado, espero que isso ajude a identificar o problema.
$ ./letsencrypt-auto help --debug --verbose
Bootstrapping dependencies for Amazon Linux...
yum is /usr/bin/yum
Loaded plugins: priorities, update-motd, upgrade-helper
Package python26-2.6.9-1.80.amzn1.x86_64 already installed and latest version
Package python26-devel-2.6.9-1.80.amzn1.x86_64 already installed and latest version
Package python26-virtualenv-12.0.7-1.10.amzn1.noarch already installed and latest version
Nothing to do
Loaded plugins: priorities, update-motd, upgrade-helper
Package git-2.4.3-6.40.amzn1.x86_64 already installed and latest version
Package gcc-4.8.3-3.20.amzn1.noarch already installed and latest version
Package dialog-1.1-9.20080819.1.5.amzn1.x86_64 already installed and latest version
Package augeas-libs-1.0.0-5.7.amzn1.x86_64 already installed and latest version
Package 1:openssl-devel-1.0.1k-10.87.amzn1.x86_64 already installed and latest version
Package libffi-devel-3.0.13-11.4.amzn1.x86_64 already installed and latest version
Package system-rpm-config-9.0.3-42.27.amzn1.noarch already installed and latest version
Package ca-certificates-2015.2.4-65.0.1.14.amzn1.noarch already installed and latest version
Nothing to do
Creating virtual environment...
Already using interpreter /usr/bin/python2.7
New python executable in /home/ec2-user/.local/share/letsencrypt/bin/python2.7
Also creating executable in /home/ec2-user/.local/share/letsencrypt/bin/python
Installing setuptools, pip...done.
Updating letsencrypt and virtual environment dependencies...
You are using pip version 6.0.8, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting setuptools from https://pypi.python.org/packages/3.5/s/setuptools/setuptools-18.7.1-py2.py3-none-any.whl#md5=a793e7b7ad3a91ca796f2e3bbd4ac355
Using cached setuptools-18.7.1-py2.py3-none-any.whl
Installing collected packages: setuptools
Found existing installation: setuptools 12.0.5
Uninstalling setuptools-12.0.5:
Successfully uninstalled setuptools-12.0.5
Successfully installed setuptools-18.7.1
You are using pip version 6.0.8, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-7.1.2-py2.py3-none-any.whl#md5=5ff9fec0be479e4e36df467556deed4d
Using cached pip-7.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 6.0.8
Uninstalling pip-6.0.8:
Successfully uninstalled pip-6.0.8
Successfully installed pip-7.1.2
Collecting letsencrypt
Using cached letsencrypt-0.1.0-py2-none-any.whl
Collecting letsencrypt-apache
Using cached letsencrypt_apache-0.1.0-py2-none-any.whl
Collecting ConfigArgParse from git+https://github.com/kuba/[email protected]#egg=ConfigArgParse (from -r ./py26reqs.txt (line 1))
Cloning https://github.com/kuba/ConfigArgParse.git (to python2.6-0.9.3) to /tmp/pip-build-3Vgs0V/ConfigArgParse
Collecting acme==0.1.0 (from letsencrypt)
Using cached acme-0.1.0-py2-none-any.whl
Requirement already up-to-date: setuptools in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Collecting python2-pythondialog>=3.2.2rc1 (from letsencrypt)
Using cached python2-pythondialog-3.3.0.tar.bz2
Collecting PyOpenSSL (from letsencrypt)
Using cached pyOpenSSL-0.15.1-py2.py3-none-any.whl
Collecting requests (from letsencrypt)
Using cached requests-2.8.1-py2.py3-none-any.whl
Collecting parsedatetime (from letsencrypt)
Using cached parsedatetime-1.5-py2-none-any.whl
Collecting configobj (from letsencrypt)
Using cached configobj-5.0.6.tar.gz
Collecting pytz (from letsencrypt)
Using cached pytz-2015.7-py2.py3-none-any.whl
Collecting psutil>=2.1.0 (from letsencrypt)
Using cached psutil-3.3.0.tar.gz
Collecting six (from letsencrypt)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting cryptography>=0.7 (from letsencrypt)
Using cached cryptography-1.1.1.tar.gz
Collecting zope.interface (from letsencrypt)
Using cached zope.interface-4.1.3.tar.gz
Collecting zope.component (from letsencrypt)
Using cached zope.component-4.2.2.tar.gz
Collecting mock (from letsencrypt)
Using cached mock-1.3.0-py2.py3-none-any.whl
Collecting pyrfc3339 (from letsencrypt)
Using cached pyRFC3339-1.0-py2.py3-none-any.whl
Collecting python-augeas (from letsencrypt-apache)
Using cached python-augeas-0.5.0.tar.gz
Collecting pyasn1 (from acme==0.1.0->letsencrypt)
Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Collecting ndg-httpsclient (from acme==0.1.0->letsencrypt)
Using cached ndg_httpsclient-0.4.0.tar.gz
Collecting werkzeug (from acme==0.1.0->letsencrypt)
Using cached Werkzeug-0.11.2-py2.py3-none-any.whl
Collecting idna>=2.0 (from cryptography>=0.7->letsencrypt)
Using cached idna-2.0-py2.py3-none-any.whl
Collecting enum34 (from cryptography>=0.7->letsencrypt)
Using cached enum34-1.1.1.tar.gz
Collecting ipaddress (from cryptography>=0.7->letsencrypt)
Using cached ipaddress-1.0.15-py27-none-any.whl
Collecting cffi>=1.1.0 (from cryptography>=0.7->letsencrypt)
Using cached cffi-1.3.1.tar.gz
Collecting zope.event (from zope.component->letsencrypt)
Using cached zope.event-4.1.0.tar.gz
Collecting funcsigs (from mock->letsencrypt)
Using cached funcsigs-0.4-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock->letsencrypt)
Using cached pbr-1.8.1-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.1.0->cryptography>=0.7->letsencrypt)
Using cached pycparser-2.14.tar.gz
Installing collected packages: pytz, requests, pyasn1, idna, six, enum34, ipaddress, pycparser, cffi, cryptography, PyOpenSSL, ndg-httpsclient, werkzeug, funcsigs, pbr, mock, pyrfc3339, acme, python2-pythondialog, parsedatetime, configobj, psutil, zope.interface, zope.event, zope.component, ConfigArgParse, letsencrypt, python-augeas, letsencrypt-apache
Running setup.py install for enum34
Running setup.py install for pycparser
Running setup.py install for cffi
Running setup.py install for cryptography
Running setup.py install for ndg-httpsclient
Running setup.py install for python2-pythondialog
Running setup.py install for configobj
Running setup.py install for psutil
Running setup.py install for zope.interface
Running setup.py install for zope.event
Running setup.py install for zope.component
Running setup.py install for ConfigArgParse
Running setup.py install for python-augeas
Successfully installed ConfigArgParse-0.9.3 PyOpenSSL acme-0.1.0 cffi configobj-5.0.6 cryptography enum34-1.1.1 funcsigs-0.4 idna-2.0 ipaddress-1.0.15 letsencrypt-0.1.0 letsencrypt-apache-0.1.0 mock-1.3.0 ndg-httpsclient-0.4.0 parsedatetime-1.5 pbr-1.8.1 psutil pyasn1-0.1.9 pycparser-2.14 pyrfc3339 python-augeas-0.5.0 python2-pythondialog-3.3.0 pytz-2015.7 requests-2.8.1 six-1.10.0 werkzeug zope.component-4.2.2 zope.event-4.1.0 zope.interface
Running with virtualenv: sudo /home/ec2-user/.local/share/letsencrypt/bin/letsencrypt help --debug --verbose
Traceback (most recent call last):
File "/home/ec2-user/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
from letsencrypt.cli import main
File "/home/ec2-user/.local/share/letsencrypt/local/lib/python2.7/dist-packages/letsencrypt/cli.py", line 17, in <module>
import OpenSSL
ImportError: No module named OpenSSL
Eu tentei resolver sem rodeios para pyOpenSSL adicionando manualmente pip install pyOpenSSL
pip install cryptography
antes de https://github.com/letsencrypt/letsencrypt/blob/master/letsencrypt-auto#L181 , mas preso com a versão cffi incompatibilidade e desisti.
Eu também tenho o erro:
$ ./letsencrypt-auto --apache -d www.3chirurgen.de -d 3chirurgen.de -d incentergy.de -d www.incentergy.de -d shop.incentergy.de
Updating letsencrypt and virtual environment dependencies......Command "/home/ec2-user/.local/share/letsencrypt/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-oV91ZI/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-GU4tNk-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ec2-user/.local/share/letsencrypt/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-build-oV91ZI/cffi
$ uname -a
Linux ip-172-31-11-205 4.1.7-15.23.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
A solução a partir de @kiwimancy funcionou:
sudo yum install python27-virtualenv
sudo ./bootstrap/_rpm_common.sh
# Output nothing to do
Próximo problema:
$ ./letsencrypt-auto --apache -d www.3chirurgen.de -d 3chirurgen.de -d incentergy.de -d www.incentergy.de -d shop.incentergy.de
Running with virtualenv: sudo /home/ec2-user/.local/share/letsencrypt/bin/letsencrypt --apache -d www.3chirurgen.de -d 3chirurgen.de -d incentergy.de -d www.incentergy.de -d shop.incentergy.de
Traceback (most recent call last):
File "/home/ec2-user/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
from letsencrypt.cli import main
File "/home/ec2-user/.local/share/letsencrypt/local/lib/python2.7/dist-packages/letsencrypt/cli.py", line 17, in <module>
import OpenSSL
ImportError: No module named OpenSSL
Solução:
$ /home/ec2-user/.local/share/letsencrypt/bin/pip install pyopenssl
Próximo problema:
Complete output from command /home/ec2-user/.local/share/letsencrypt/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-5_HYBt/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BxpscI-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ec2-user/.local/share/letsencrypt/include/site/python2.7/cffi:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cffi
copying cffi/ffiplatform.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/api.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/recompiler.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/vengine_gen.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/model.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/cparser.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/__init__.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/gc_weakref.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/lock.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/verifier.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/commontypes.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-2.7/cffi
copying cffi/_cffi_include.h -> build/lib.linux-x86_64-2.7/cffi
copying cffi/parse_c_type.h -> build/lib.linux-x86_64-2.7/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/c
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DUSE__THREAD -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/ec2-user/.local/share/letsencrypt/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-5_HYBt/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BxpscI-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ec2-user/.local/share/letsencrypt/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-build-5_HYBt/cffi
Solução:
sudo yum install python27-devel
Próximo problema:
O plugin do apache não está funcionando; pode haver problemas com sua configuração existente.
O erro foi: NoInstallationError()
2015-12-04 08:18:50,797:DEBUG:letsencrypt.cli:Root logging level set at 20
2015-12-04 08:18:50,798:INFO:letsencrypt.cli:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2015-12-04 08:18:50,807:DEBUG:letsencrypt.cli:letsencrypt version: 0.1.0
2015-12-04 08:18:50,807:DEBUG:letsencrypt.cli:Arguments: ['-v', '--debug', '--apache', '-d', 'www.3chirurgen.de', '-d', '3chirurgen.de', '-d', 'incentergy.de', '-d', 'www.incentergy.de', '-d', 'shop.incentergy.de']
2015-12-04 08:18:50,809:DEBUG:letsencrypt.cli:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#webroot,PluginEntryPoint#null,PluginEntryPoint#manual,PluginEntryPoint#standalone)
2015-12-04 08:18:50,814:DEBUG:letsencrypt.cli:Requested authenticator apache and installer apache
2015-12-04 08:18:50,820:DEBUG:letsencrypt.plugins.disco:No installation (PluginEntryPoint#apache):
Traceback (most recent call last):
File "/home/ec2-user/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/plugins/disco.py", line 103, in prepare
self._initialized.prepare()
File "/home/ec2-user/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 142, in prepare
raise errors.NoInstallationError
NoInstallationError
2015-12-04 08:18:50,821:DEBUG:letsencrypt.display.ops:No candidate plugin
2015-12-04 08:18:50,821:DEBUG:letsencrypt.cli:Selected authenticator None and installer None
Vou cavar isso mais tarde.
./letsencrypt-auto -v
Updating letsencrypt and virtual environment dependencies...
Requirement already up-to-date: setuptools in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages
Requirement already up-to-date: pip in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages
Requirement already up-to-date: letsencrypt in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages
Requirement already up-to-date: letsencrypt-apache in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages
Requirement already up-to-date: zope.interface in /home/ec2-user/.local/share/letsencrypt/lib64/python2.7/site-packages (from letsencrypt)
Requirement already up-to-date: setuptools in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Requirement already up-to-date: python2-pythondialog>=3.2.2rc1 in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Collecting PyOpenSSL (from letsencrypt)
Using cached pyOpenSSL-0.15.1-py2.py3-none-any.whl
Requirement already up-to-date: requests in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Collecting cryptography>=0.7 (from letsencrypt)
Using cached cryptography-1.1.2.tar.gz
Requirement already up-to-date: parsedatetime in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Requirement already up-to-date: configobj in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Requirement already up-to-date: pytz in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Collecting psutil>=2.1.0 (from letsencrypt)
Using cached psutil-3.3.0.tar.gz
Requirement already up-to-date: six in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Requirement already up-to-date: acme==0.1.1 in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Requirement already up-to-date: zope.component in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Requirement already up-to-date: mock in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Requirement already up-to-date: ConfigArgParse in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt)
Collecting pyrfc3339 (from letsencrypt)
Using cached pyRFC3339-1.0-py2.py3-none-any.whl
Requirement already up-to-date: python-augeas in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from letsencrypt-apache)
Requirement already up-to-date: idna>=2.0 in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from cryptography>=0.7->letsencrypt)
Requirement already up-to-date: pyasn1>=0.1.8 in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from cryptography>=0.7->letsencrypt)
Requirement already up-to-date: enum34 in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from cryptography>=0.7->letsencrypt)
Requirement already up-to-date: ipaddress in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from cryptography>=0.7->letsencrypt)
Collecting cffi>=1.1.0 (from cryptography>=0.7->letsencrypt)
Using cached cffi-1.4.2.tar.gz
Requirement already up-to-date: ndg-httpsclient in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from acme==0.1.1->letsencrypt)
Collecting werkzeug (from acme==0.1.1->letsencrypt)
Using cached Werkzeug-0.11.3-py2.py3-none-any.whl
Requirement already up-to-date: zope.event in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from zope.component->letsencrypt)
Requirement already up-to-date: funcsigs in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from mock->letsencrypt)
Requirement already up-to-date: pbr>=0.11 in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from mock->letsencrypt)
Requirement already up-to-date: pycparser in /home/ec2-user/.local/share/letsencrypt/lib/python2.7/dist-packages (from cffi>=1.1.0->cryptography>=0.7->letsencrypt)
Installing collected packages: cffi, cryptography, PyOpenSSL, psutil, pyrfc3339, werkzeug
Running setup.py install for cffi
Running setup.py install for cryptography
Running setup.py install for psutil
Successfully installed PyOpenSSL cffi cryptography psutil pyrfc3339 werkzeug
Requesting root privileges to run with virtualenv: sudo /home/ec2-user/.local/share/letsencrypt/bin/letsencrypt -v
Traceback (most recent call last):
File "/home/ec2-user/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
from letsencrypt.cli import main
File "/home/ec2-user/.local/share/letsencrypt/local/lib/python2.7/dist-packages/letsencrypt/cli.py", line 17, in <module>
import OpenSSL
ImportError: No module named OpenSSL
pip install pyopenssl
não resolve isso.
OK, então eu acredito que encontrei uma solução para este problema.
Tudo se resume a executar como root ou executar via sudo, o uso de vários locais de pacotes para instalação do pip (lib/lib64, site-packages/dist-packages, /usr vs /usr/local).
Me deparei com este problema semelhante:
http://stackoverflow.com/questions/33661818/python-virtualenv-importerror-with-celery-and-billiard
Acontece que as versões pip e virtualenv que acompanham o Amazon Linux, mesmo na AMI mais recente, estão desatualizadas e (possivelmente) têm bugs na forma como lib64/dist-packages são tratados para ambientes virtuais.
Atualizar ambos os programas via pip e, em seguida, recriar o ambiente virtual parece corrigir o problema ao executar a configuração como root (sem usar sudo). As soluções fornecidas em outros tópicos e este para executar o pip da pasta virtualenv para reinstalar as dependências estão corrigindo um sintoma, não a causa.
Problema semelhante relatado aqui:
https://community.letsencrypt.org/t/letsencrypt-auto-openssl-module-not-found-ec2/4356
A solução de eric-tucker acima funcionou para mim também. Obrigada!
Vim aqui do Google, tive problemas semelhantes com todos os módulos python compilados no virtualenv no Amazon Linux 2015.09.1.
eric-tucker está certo, atualizar o virtualenv manualmente ajuda aqui.
Descobri que o culpado era a variável env PYTHON_INSTALL_LAYOUT=amzon
que, por padrão, não está definida no Amazon Linux - e você não percebe o problema. Mas uma vez definido, as coisas não funcionam com a versão padrão do virtualenv, porque os pacotes são instalados em lib64/python2.7/dist-packages
e isso não é adicionado pelo site.py
do virtualenv (pelo menos não na versão que vem de rpm; apenas lib/python2.7/dist-packages
é adicionado).
A parte complicada, pelo menos para mim, foi descobrir qual pacote definiu essa variável para mim. Acontece que foi causado pela instalação do grupo " @Development tools" do yum e especificamente o pacote system-rpm-config
. Não tão óbvio...
Sim! Eu resolvi!. Obrigado eric tucker!
Executei o seguinte comando.
# pip install pip --upgrade
# pip install virtualenv --upgrade
# virtualenv -p /usr/bin/python27 venv27
# . venv27/bin/activate
# git clone https://github.com/letsencrypt/letsencrypt
# cd letsencrypt
# ./letsencrypt-auto certonly --debug --standalone -d <domain-name>
Atualização para @skatsumata para 2017 e certbot-auto:
# rm /root/.local/share/letsencrypt/ -Rf
# pip install pip --upgrade
# pip install virtualenv --upgrade
# virtualenv -p /usr/bin/python27 venv27
# . venv27/bin/activate
# ./certbot-auto renew --debug #(or whatever your relevant command is)
Eu só tive que correr sudo yum install python27-devel
para que isso funcionasse para mim, obrigado!
@zarmstrong Muito obrigado, isso funciona. BTW eu quero configurar um cron para renovar automaticamente. Como faço isso com sua solução?
Não tenho certeza se isso vai funcionar, não testado. Mas você pode tentar.
#!/bin/bash
date
cd /root
source venv27/bin/activate
./certbot-auto renew --debug
/etc/init.d/httpd reload
Certifique-se de redirecionar a saída para algum tipo de log e verifique se funciona.
Isso deve ser corrigido em nossa próxima versão com #4978.
@bmw Não acredito que isso tenha sido corrigido. Estou enfrentando esse mesmo problema de lib/lib64 ainda em ambientes AWS Elastic Beanstalk com a versão mais recente do certbot baixada da seguinte forma:
wget https://dl.eff.org/certbot-auto; chmod a+x certbot-auto
# cat /etc/system-release
Amazon Linux AMI release 2017.09
[root@ip-172-31-10-255 venv]# /certbot/certbot-auto --debug renew
Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt:
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 41, 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 rand, crypto, SSL
File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/rand.py", line 12, in <module>
from OpenSSL._util import (
File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
ImportError: No module named cryptography.hazmat.bindings.openssl.binding
Estou perplexo com a quantidade de problemas que estamos tendo com as dependências do Python e quais não.
No entanto, se você instalar o certbot via pip, acho que as coisas funcionam. Você já tentou isso @utdrmac ? Eu sei que resolveu muitos dos meus problemas.
Não sabia que instalar via pip era uma opção. Eu estava seguindo alguns posts sobre o uso do certbot no beanstalk e seus scripts baixaram como coloquei acima. Talvez a postagem do blog esteja desatualizada. Testando via pip agora:
# rm -rf /opt/eff.org/*
# pip install -U certbot
# certbot renew --debug
Parece ter funcionado! Vou ajustar meus scripts para instalar o certbot usando o pip do sistema em vez de baixá-lo diretamente. Talvez haja algum problema com o instalador/atualizador interno do certbots a esse respeito?
Honestamente, não tenho ideia de por que a instalação via pip não é a abordagem recomendada em TODOS os sistemas operacionais.
A solução original de baixar um arquivo que tenta configurar um virtualenv e falha miseravelmente na metade do tempo precisa do DIAF.
O erro é com o caminho python e o uso de dist-packages
. Podemos adicionar uma configuração de caminho, por exemplo, dist.pth
, a /opt/eff.org/certbot/venv/lib64/python2.7/site-packages/dist.pth
. No entanto, os arquivos pth
são processados apenas se estiverem em um diretório de site (por exemplo, site-packages
) e os arquivos pth
no caminho recém-nomeado (por exemplo, pacotes dist) não ser lido. Criamos um sitecustomize.py em /opt/eff.org/certbot/venv/lib64/python2.7/site-packages/
com o seguinte:
import site
site.addsitedir('/opt/eff.org/certbot/venv/lib64/python2.7/dist-packages')
O sitecustomize.py
define dist-packages como um diretório de sites e lerá com sucesso o zope.interface-4.4.3-py2.7-nspkg.pth
. Isso evita o erro $ from zope.interface import Interface
ImportError
.
Além disso, descobri que /usr/local/bin/certbot-auto
recria o virtualenv venv
. Isso resultará no mesmo erro de caminho python que estamos tentando evitar. Eu recomendo aplicar o acima e fornecer manualmente o script de ativação em venv
; por exemplo, . /opt/eff.org/certbot/venv/bin/activate
.
Eu prefiro essa abordagem porque evita atacar pacotes python no nível do sistema.
Não que isso diga algo diferente do que acima, mas a solução rápida para mim no certbot 0.21.1 foi "mover" efetivamente as ligações de risco de criptografia para onde a versão personalizada do python do letsencrypt está procurando:
cd /opt/eff.org/certbot/venv/lib64/python2.7
mv site-packages site-packages.sav
ln -s dist-packages/ site-packages
Isso funciona para mim porque o site-packages/ subdir está vazio para mim. E para ser claro, isso corrige o seguinte erro que aparece nas versões recentes do certbot no Amazon Linux, para mim certbot 0.21.0 e 0.21.1:
<snip>
File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
ImportError: No module named cryptography.hazmat.bindings.openssl.binding
A resposta que o @utdrmac escreveu é o que acabei usando, obrigado Matthew!
Mas eu recebi o erro: "The requested apache plugin does not appear to be installed"
Então eu fiz: sudo -H pip install certbot-apache
eu tive o mesmo erro e de alguma forma resolvi isso
Como eu tinha duas versões do python install, python 2 e 3, tive que descobrir qual no certbot/letencrypt estava usando. esse reportará erro ao tentar importar criptografia ....
na linha de comando
python
from cryptography.hazmat.bindings._constant_time import lib
nenhum erro de importação, então eu fiz o mesmo com python3 e recebi o erro No module named '_cffi_backend
. Então eu simplesmente instalei o módulo cffi com pip3
sudo -H pip3 install cffi
sudo -H porque era necessário como um pacote global
fez certbot help
seguida e obteve um erro de importação para urllib3
. Instalei isso com pip3 e agora tudo funciona bem.
Espera que alguém ache isso útil
Eu também tive esse problema em uma instância do AWS EC2, apenas corrigido executando a solução do @utdrmac como root. Ele estava atualizando para o certbot 0.22.0
Muito obrigado @utdrmac pela solução. Eu tenho tentado tantas coisas nos últimos dois dias e nada funcionou.
Encontrei esse problema hoje e descobri ainda que a solução @utdrmac não funciona no AWS EC2 executando o Amazon Linux AMI 2017.09. O erro que encontro na etapa final é:
$ sudo certbot renew --debug
/usr/lib64/python2.6/dist-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. The next version of cryptography will drop support for Python 2.6
DeprecationWarning
Traceback (most recent call last):
File "/usr/bin/certbot", line 7, in <module>
from certbot.main import main
File "/usr/lib/python2.6/dist-packages/certbot/main.py", line 11, in <module>
import zope.component
File "/usr/lib/python2.6/dist-packages/zope/component/__init__.py", line 28, in <module>
from zope.component.globalregistry import getGlobalSiteManager
File "/usr/lib/python2.6/dist-packages/zope/component/globalregistry.py", line 18, in <module>
from zope.interface.registry import Components
File "/usr/lib64/python2.6/dist-packages/zope/interface/registry.py", line 167
filtered_state = {k: v for k, v in reduction[2].items()
^
SyntaxError: invalid syntax
Para executar o certbot, fui forçado a estender esta solução instalando um Python mais recente e utilizando-o, assim:
sudo rm -rf /opt/eff.org/*
sudo yum -y install python36 python36-pip python36-libs python36-tools python36-virtualenv
sudo /usr/bin/pip-3.6 install -U certbot
sudo /usr/bin/pip-3.6 install certbot-apache
sudo /usr/local/bin/certbot renew --debug
Observe que eu separadamente sudo
cada comando nesta proposta porque quando tentei juntar todos eles (como em sudo su -
), essa sequência de etapas falhou porque algumas configurações antigas do Python poluíram o ambiente, causando certbot para finalmente falhar, de qualquer maneira.
@wwkimball Para ser justo, minha solução/problema foi para o Elastic Beanstalk. Parece que também estou executando o AMI 2017.09, então não tenho certeza por que o seu é diferente de todos os outros.
Eu tive o mesmo problema. Aqui está o que resolveu para mim:
/opt/eff.org/certbot/venv/local/bin/pip instalar interface de criptografia
A solução de @gmegidish corrigiu esse problema para mim.
Nada além de https://github.com/certbot/certbot/issues/1680#issuecomment -374046383 por @wwkimball funcionou para mim.
Obrigado pela solução! :100:
FWIW, isso é o que eu juntei para trabalhar na minha instância do AWS Linux:
#!/bin/bash -x
# If run in cron, add /usr/local to cron's sanitized PATH
export PATH=$PATH:/usr/local/sbin:/usr/local/bin
INSTALLED=/usr/local/bin
$INSTALLED/certbot-auto $@
if [ $? -ne 0 ]; then
# certbot-auto used venv to install modules, but something
# about the way it put things together put pieces in a subdir
# that python doesn't look in by default on AWS Linux. Fix it.
BASEDIR="/opt/eff.org/certbot/venv/lib64/python2.7"
cat << " EOM"
1. Getting rid of empty $BASEDIR/site-packages.
2. Create symlink "site-packages" to "dist-packages/".
EOM
if [ -d $BASEDIR ]; then
cd $BASEDIR
rm -rf site-packages
ln -s dist-packages/ site-packages
else
echo "ERROR: $BASEDIR doesn't exist, python version changed?"
fi
$INSTALLED/certbot-auto $@
fi
Optei por deixar a variável INSTALLED
no lugar caso alguém queira instalar o script certbot-auto
em algum lugar diferente do caminho. Eu chamo de run_certbot.sh e chamo com os argumentos que quero passar para certbot-auto:
run_certbot.sh renew --debug
@mrballcb Obrigado! funcionar perfeitamente.
sudo pip3 install cryptography
sudo pip3 install interface
trabalhou para mim
./certbot-auto --no-bootstrap
Isso funcionou para mim
Consegui instalar e executar o certbot com sucesso no Amazon Linux 1 por meio do método pip (python36 que inclui pip). O método yum encontrou os erros abaixo que estavam acima da minha capacidade de diagnosticar.
Complete!
Creating virtual environment...
Traceback (most recent call last):
File "<stdin>", line 27, in <module>
File "<stdin>", line 19, in create_venv
File "/usr/lib64/python2.7/subprocess.py", line 185, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 172, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib64/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
@ micharu123 Obrigado por sua postagem, sua solução corrigiu o mesmo problema para mim. Felicidades
Eu tive alguns dos mesmos problemas mencionados aqui, e a solução foi simplesmente mover o executável "certbot-auto" para /usr/local/bin/ . Isso corrigiu todos os erros imediatamente no meu servidor AWS.
Comentários muito úteis
Não sabia que instalar via pip era uma opção. Eu estava seguindo alguns posts sobre o uso do certbot no beanstalk e seus scripts baixaram como coloquei acima. Talvez a postagem do blog esteja desatualizada. Testando via pip agora:
Parece ter funcionado! Vou ajustar meus scripts para instalar o certbot usando o pip do sistema em vez de baixá-lo diretamente. Talvez haja algum problema com o instalador/atualizador interno do certbots a esse respeito?