Certbot: error de instalacion en amazon linux

Creado en 3 dic. 2015  ·  37Comentarios  ·  Fuente: certbot/certbot

corrí
./letsencrypt-auto --ayuda --depuración
para instalar permite cifrar.

Todos los paquetes se instalaron correctamente, pero luego se produce el siguiente error:
Creando entorno virtual...
Actualizando las dependencias de letsencrypt y del entorno 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'), archivo , '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" falló con el código de error 1 en /dev/shm/pip-build-OslHtf/cffi

¿Alguna idea? Me doy cuenta de que el soporte de Amazon Linux es experimental y no tengo la intención de usar todas las herramientas de automatización (todavía), pero sería genial si al menos pudiera generar certificados manualmente.

certbot-auto

Comentario más útil

No sabía que la instalación a través de pip era una opción. Estaba siguiendo algunas publicaciones de blog sobre el uso de certbot en beanstalk y sus scripts lo descargaron como lo puse arriba. Tal vez la publicación del blog esté desactualizada. Probando a través de pip ahora:

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

¡Parece haber funcionado! Ajustaré mis scripts para instalar certbot usando system pip en lugar de descargarlo directamente. ¿Quizás hay algún problema con el instalador/actualizador integrado de certbots en este sentido?

Todos 37 comentarios

Desde #1458 ,

Pude ejecutar el cliente con un letsencrypt-auto modificado en Amazon Linux 2015.03 instalando manualmente el paquete python27-virtualenv primero y luego ejecutando la ruta de arranque de RedHat.

Hice eso y parece estar funcionando. Debe ejecutar sudo yum install python27-virtualenv y sudo ./bootstrap/_rpm_common.sh

@barshinoff Tengo curiosidad por saber si esto está relacionado con el n. ° 1677 (un error de falta de memoria al compilar dependencias cffi en otras distribuciones de la familia redhat) He comprobado que ./letsencrypt-auto funciona en instalaciones limpias de amazon linux 2015.09 .1 y 2015.03.1 en instancias t2.micro sin nada más ejecutándose. ¿En qué tipo de instancia y AMI está probando esto? Si lo ejecuta detalladamente con '-v' ./letsencrypt-auto --help --debug -v, podría arrojar más información sobre lo que está sucediendo.

Hola, gracias por el consejo.
No es un problema de memoria, para asegurarme de que no se estaba ejecutando nada más y conecté una unidad de intercambio de 40 gb.
Estoy ejecutando la distribución 2015.09 con todos los paquetes actualizados.

Instalar primero el paquete python27-virtualenv y luego ejecutar la ruta de arranque de RedHat como sugirió @kiwimancy me ayudó a superar el error inicial.
El error que recibo ahora es:
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

Mismo error aquí en el mismo 2015.09 Amazon Linux.
A continuación se muestra el registro detallado, espero que esto ayude a identificar el 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

Traté sin rodeos de resolver pyOpenSSL agregando manualmente pip install pyOpenSSL pip install cryptography antes de https://github.com/letsencrypt/letsencrypt/blob/master/letsencrypt-auto#L181 , pero me quedé con la versión cffi incompatibilidad y se dio por vencido.

Tengo el error también:

$ ./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

La solución a partir de @kiwimancy funcionó:

sudo yum install python27-virtualenv
sudo ./bootstrap/_rpm_common.sh
# Output nothing to do

Siguiente 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

Solución:

$ /home/ec2-user/.local/share/letsencrypt/bin/pip install pyopenssl

siguiente 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

Solución:

sudo yum install python27-devel

siguiente problema:

El complemento de apache no funciona; puede haber problemas con su configuración existente.
El error fue: 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

Profundizaré en esto más 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 no resuelve esto.

Bien, creo que encontré una solución a este problema.

Todo se reduce a ejecutar como root o mediante sudo, el uso de múltiples ubicaciones de paquetes para la instalación de pip (lib/lib64, site-packages/dist-packages, /usr vs /usr/local).

Me encontré con este problema similar:
http://stackoverflow.com/questions/33661818/python-virtualenv-importerror-with-celery-and-billar

Resulta que las versiones de pip y virtualenv que se envían con Amazon Linux, incluso en la última AMI, están desactualizadas y (posiblemente) tienen errores en la forma en que se maneja lib64/dist-packages para entornos virtuales.

Actualizar ambos programas a través de pip y luego recrear el entorno virtual parece solucionar el problema cuando se ejecuta la instalación como root (sin usar sudo). Las soluciones dadas en otros subprocesos y este para ejecutar pip desde la carpeta virtualenv para reinstalar dependencias están solucionando un síntoma, no la causa.

Problema similar informado aquí:
https://community.letsencrypt.org/t/letsencrypt-auto-openssl-module-not-found-ec2/4356

La solución anterior de eric-tucker también funcionó para mí. ¡Gracias!

Vine aquí desde Google, tuve problemas similares con todos los módulos de python compilados en virtualenv en el último Amazon Linux 2015.09.1.

eric-tucker tiene razón, actualizar virtualenv manualmente ayuda aquí.

Descubrí que el culpable era la variable env PYTHON_INSTALL_LAYOUT=amzon que, de manera predeterminada, no está configurada en Amazon Linux, y luego no nota el problema. Pero una vez que esto está configurado, las cosas no funcionan con la versión predeterminada de virtualenv, porque los paquetes se instalan en lib64/python2.7/dist-packages y esto no se agrega mediante site.py de virtualenv (al menos no en la versión que viene de paquete rpm; solo se agrega lib/python2.7/dist-packages ).

La parte complicada, al menos para mí, fue averiguar qué paquete definía esta variable para mí. Resultó que fue causado por la instalación del grupo "Herramientas @Development " de yum y específicamente el paquete system-rpm-config . No tan obvio...

¡Sí! ¡Lo resolví!. Gracias eric-tucker!

Ejecuté el siguiente 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>

Actualización a @skatsumata para 2017 y 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)

Solo tuve que ejecutar sudo yum install python27-devel para que esto me funcionara, ¡gracias!

@zarmstrong Muchas gracias, eso funciona. Por cierto, quiero configurar un cron para que se renueve automáticamente. ¿Cómo hago eso con tu solución?

No estoy seguro de si esto funcionará, no probado. Pero puedes intentarlo.

#!/bin/bash
date
cd /root
source venv27/bin/activate
./certbot-auto renew --debug
/etc/init.d/httpd reload

Asegúrese de redirigir la salida a algún tipo de registro y verifique que funcione.

Esto debería arreglarse en nuestra próxima versión con #4978.

@bmw No creo que esto se haya solucionado. Sigo experimentando este mismo problema de lib/lib64 todavía en entornos de AWS Elastic Beanstalk con la última versión de certbot descargada de la siguiente manera:

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

Estoy desconcertado por la cantidad de problemas que estamos teniendo con las dependencias de Python y demás.

Sin embargo, si instala certbot a través de pip, creo que las cosas funcionan. ¿Has probado este @utdrmac ? Sé que resolvió muchos de mis problemas.

No sabía que la instalación a través de pip era una opción. Estaba siguiendo algunas publicaciones de blog sobre el uso de certbot en beanstalk y sus scripts lo descargaron como lo puse arriba. Tal vez la publicación del blog esté desactualizada. Probando a través de pip ahora:

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

¡Parece haber funcionado! Ajustaré mis scripts para instalar certbot usando system pip en lugar de descargarlo directamente. ¿Quizás hay algún problema con el instalador/actualizador integrado de certbots en este sentido?

Honestamente, no tengo idea de por qué la instalación a través de pip no es el enfoque recomendado en TODOS los sistemas operativos.

La solución original de descargar un archivo que intenta configurar un virtualenv y falla miserablemente la mitad del tiempo necesita DIAF.

El error está en la ruta de Python y el uso de dist-packages . Podemos agregar una configuración de ruta, por ejemplo, dist.pth , a /opt/eff.org/certbot/venv/lib64/python2.7/site-packages/dist.pth . Sin embargo, los archivos pth solo se procesan si están en un directorio de sitio (p. ej., site-packages ) y los archivos pth en la ruta recién designada (es decir, dist-packages) no ser leído. Creamos un sitecustomize.py en /opt/eff.org/certbot/venv/lib64/python2.7/site-packages/ con lo siguiente:

import site
site.addsitedir('/opt/eff.org/certbot/venv/lib64/python2.7/dist-packages')

El sitecustomize.py establece dist-packages como un directorio de sitio y leerá con éxito el zope.interface-4.4.3-py2.7-nspkg.pth . Esto evita el error $ from zope.interface import Interface ImportError .

Además, descubrí que /usr/local/bin/certbot-auto recrea el virtualenv venv . Esto dará como resultado el mismo error de ruta de Python que estamos tratando de evitar. Recomiendo aplicar lo anterior y obtener manualmente el script de activación en venv ; por ejemplo, . /opt/eff.org/certbot/venv/bin/activate .

Prefiero este enfoque porque evita criticar los paquetes de python a nivel del sistema.

No es que esto diga algo diferente a lo anterior, pero la solución rápida para mí en certbot 0.21.1 fue "mover" de manera efectiva los enlaces de materiales peligrosos de criptografía a donde está buscando la versión personalizada de python de letsencrypt:

cd /opt/eff.org/certbot/venv/lib64/python2.7
mv site-packages site-packages.sav
ln -s dist-packages/ site-packages

Esto funciona para mí porque el sitio-paquetes/ subdirectorio está vacío para mí. Y para ser claros, esto soluciona el siguiente error que aparece en versiones recientes de certbot en Amazon Linux, para mí certbot 0.21.0 y 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

La respuesta que escribió @utdrmac es la que terminé usando, ¡gracias Matthew!

Pero tengo el error: "The requested apache plugin does not appear to be installed"
Así lo hice: sudo -H pip install certbot-apache

Tuve el mismo error y de alguna manera lo resolví.

Como tenía dos versiones de python install, python 2 y 3, tenía que averiguar cuál estaba usando en certbot/letencrypt. ese informará un error al intentar importar criptografía ...

en la línea de comando

python
from cryptography.hazmat.bindings._constant_time import lib

no hay error de importación, así que hice lo mismo con python3 y obtuve el error No module named '_cffi_backend . Así que simplemente instalé el módulo cffi con pip3
sudo -H pip3 install cffi

sudo -H porque era necesario como un paquete global

hizo certbot help a continuación y luego recibió un error de importación para urllib3 . Instalé eso con pip3 y ahora todo funciona bien.

Espera que alguien encuentre esto útil

También tuve este problema en una instancia de AWS EC2, solo se solucionó ejecutando la solución de @utdrmac como root. Se estaba actualizando a certbot 0.22.0

Muchas gracias @utdrmac por la solución. Estuve intentando tantas cosas en los últimos dos días y nada había funcionado.

Me encontré con este problema hoy y descubrí que la solución @utdrmac no funciona en AWS EC2 con Amazon Linux AMI 2017.09. El error que encuentro en el paso final es:

$ 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 que certbot se ejecutara, me vi obligado a ampliar esta solución instalando un Python más nuevo y utilizándolo, por lo tanto:

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

Tenga en cuenta que sudo por separado cada comando en esta propuesta porque cuando traté de agruparlos todos juntos (como en sudo su - ), esta secuencia de pasos falló porque algunas configuraciones antiguas de Python contaminaron el entorno, causando certbot para finalmente fallar, de todos modos.

@wwkimball Para ser justos, mi solución/problema fue para Elastic Beanstalk. Parece que también estoy ejecutando AMI 2017.09, así que no estoy seguro de por qué el tuyo es diferente al de los demás.

Tuve el mismo problema. Esto es lo que me resolvió:

/opt/eff.org/certbot/venv/local/bin/pip instalar interfaz criptográfica

La solución de @gmegidish me solucionó este problema.

Nada más que https://github.com/certbot/certbot/issues/1680#issuecomment -374046383 de @wwkimball funcionó para mí.
¡Gracias por la solución! :100:

FWIW, esto es lo que armé para trabajar en mi instancia de 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

Elegí dejar la variable INSTALLED en su lugar en caso de que alguien quiera instalar el script certbot-auto en otro lugar que no sea la ruta. Lo llamo run_certbot.sh y lo llamo con los argumentos que quiero pasar a certbot-auto:

run_certbot.sh renew --debug

@mrballcb ¡Gracias! funciona perfectamente

sudo pip3 install cryptography
sudo pip3 install interface
trabajó para mi

./certbot-auto --sin arranque

esto funcionó para mí

Pude instalar y ejecutar certbot con éxito en Amazon Linux 1 a través del método pip (python36 que incluye pip). El método yum encontró los siguientes errores que estaban por encima de mi capacidad de diagnóstico.

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 Gracias por su publicación, su solución solucionó el mismo problema para mí. Salud

Tuve algunos de los mismos problemas que se mencionan aquí, y la solución fue simplemente mover el ejecutable "certbot-auto" a /usr/local/bin/ . Esto solucionó todos los errores de inmediato en mi servidor de AWS.

¿Fue útil esta página
0 / 5 - 0 calificaciones