Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

certbot-auto: Print link to doc on debugging pip install error [revision requested] #3473

Merged
merged 6 commits into from
Dec 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ For full command line help, you can type::

./certbot-auto --help all

Problems with Python virtual environment
----------------------------------------

On a low memory system such as VPS with only 256MB of RAM, the required dependencies of Certbot will failed to build.
This can be identified if the pip outputs contains something like ``internal compiler error: Killed (program cc1)``.
You can workaround this restriction by creating a temporary swapfile::

user@webserver:~$ sudo fallocate -l 1G /tmp/swapfile
user@webserver:~$ sudo chmod 600 /tmp/swapfile
user@webserver:~$ sudo mkswap /tmp/swapfile
user@webserver:~$ sudo swapon /tmp/swapfile

Disable and remove the swapfile once the virtual enviroment is constructed::

user@webserver:~$ sudo swapoff /tmp/swapfile
user@webserver:~$ sudo rm /tmp/swapfile

Running with Docker
-------------------

Expand Down
21 changes: 21 additions & 0 deletions letsencrypt-auto-source/letsencrypt-auto.template
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,28 @@ UNLIKELY_EOF
# Report error. (Otherwise, be quiet.)
echo "Had a problem while installing Python packages."
if [ "$VERBOSE" != 1 ]; then
echo
echo "pip prints the following errors: "
echo "====================================================="
echo "$PIP_OUT"
echo "====================================================="
echo
echo "Certbot has problem setting up the virtual environment."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we grep "$PIP_OUT" for the relevant error strings, so that we're only printing the hint about swap space if that's the actual error the user encountered?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which string 😝? internal compiler error: Killed (program cc1) could happen because of other reasons. I don't feel particularly good to make unreliable guesses.

I can grep that if you think that is the right string to grep.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconveniently, the error can crop up in a bunch of different ways, depending on which exact step the compilation gets to, and whether it's a specific compilation step that fails, or the kernel's OOM killer that steps in and breaks something. Here are a few different examples I've seen. These are all on DO droplets, using stress to simulate low memory conditions (since apparently 512MB is now typically enough to run certbot-auto, which is nice :)

Ubuntu 16.04, 26MB available:

(letsencrypt) root@certbot-auto-memtest:~# free

              total        used        free      shared  buff/cache   available
Mem:         500240      445120       16996         648       38124       26664
Swap:             0           0           0

(letsencrypt) root@certbot-auto-memtest:~# pip install cryptography
Collecting cryptography
Killed

CentOS 6.8 (31MB free)

(letsencrypt)[root@certbot-auto-memtest letsencrypt]# free
             total       used       free     shared    buffers     cached
Mem:        502000     470716      31284        148       4940      11312
-/+ buffers/cache:     454464      47536
Swap:            0          0          0
(letsencrypt)[root@certbot-auto-memtest letsencrypt]# pip install cryptography
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting cryptography
/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading cryptography-1.5.tar.gz (400kB)
    100% |████████████████████████████████| 401kB 406kB/s 
    Error [Errno 12] Cannot allocate memory while executing command python setup.py egg_info
Exception:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/commands/install.py", line 310, in run
    wb.build(autobuilding=True)
  File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/wheel.py", line 747, in build
    self.requirement_set.prepare_files(self.finder)
  File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/req/req_set.py", line 359, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/req/req_set.py", line 590, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/req/req_set.py", line 127, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/req/req_install.py", line 440, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/utils/__init__.py", line 677, in call_subprocess
    cwd=cwd, env=env)
  File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.6/subprocess.py", line 1144, in _execute_child
    self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
You are using pip version 8.0.3, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

CentOS 6.x, ~100MB free:

letsencrypt)[root@certbot-auto-memtest letsencrypt]# free
             total       used       free     shared    buffers     cached
Mem:        502000     405212      96788        148       5296      26732
-/+ buffers/cache:     373184     128816
Swap:            0          0          0
(letsencrypt)[root@certbot-auto-memtest letsencrypt]# pip install cryptography
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting cryptography
/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/root/.local/share/letsencrypt/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Using cached cryptography-1.5.tar.gz
Requirement already satisfied (use --upgrade to upgrade): idna>=2.0 in ./lib/python2.6/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.8 in ./lib/python2.6/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4.1 in ./lib/python2.6/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): setuptools>=11.3 in ./lib/python2.6/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): enum34 in ./lib/python2.6/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): ipaddress in ./lib/python2.6/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): cffi>=1.4.1 in ./lib/python2.6/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): ordereddict in ./lib/python2.6/site-packages (from enum34->cryptography)
Requirement already satisfied (use --upgrade to upgrade): pycparser in ./lib/python2.6/site-packages (from cffi>=1.4.1->cryptography)
Building wheels for collected packages: cryptography
  Running setup.py bdist_wheel for cryptography ... error
  Complete output from command /root/.local/share/letsencrypt/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-NtR_nB/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpe_5tXapip-wheel- --python-tag cp26:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.6
  creating build/lib.linux-x86_64-2.6/cryptography
  copying src/cryptography/fernet.py -> build/lib.linux-x86_64-2.6/cryptography
  copying src/cryptography/__init__.py -> build/lib.linux-x86_64-2.6/cryptography
  copying src/cryptography/__about__.py -> build/lib.linux-x86_64-2.6/cryptography
  copying src/cryptography/utils.py -> build/lib.linux-x86_64-2.6/cryptography
  copying src/cryptography/exceptions.py -> build/lib.linux-x86_64-2.6/cryptography
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat
  copying src/cryptography/hazmat/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat
  creating build/lib.linux-x86_64-2.6/cryptography/x509
  copying src/cryptography/x509/base.py -> build/lib.linux-x86_64-2.6/cryptography/x509
  copying src/cryptography/x509/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/x509
  copying src/cryptography/x509/general_name.py -> build/lib.linux-x86_64-2.6/cryptography/x509
  copying src/cryptography/x509/extensions.py -> build/lib.linux-x86_64-2.6/cryptography/x509
  copying src/cryptography/x509/oid.py -> build/lib.linux-x86_64-2.6/cryptography/x509
  copying src/cryptography/x509/name.py -> build/lib.linux-x86_64-2.6/cryptography/x509
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings
  copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/multibackend.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/serialization.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/openssl
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/commoncrypto
  copying src/cryptography/hazmat/bindings/commoncrypto/binding.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/commoncrypto
  copying src/cryptography/hazmat/bindings/commoncrypto/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/commoncrypto
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
  copying src/cryptography/hazmat/backends/commoncrypto/hmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
  copying src/cryptography/hazmat/backends/commoncrypto/ciphers.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
  copying src/cryptography/hazmat/backends/commoncrypto/hashes.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
  copying src/cryptography/hazmat/backends/commoncrypto/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
  copying src/cryptography/hazmat/backends/commoncrypto/backend.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/interfaces
  copying src/cryptography/hazmat/primitives/interfaces/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/interfaces
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
  creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
  running egg_info
  writing requirements to src/cryptography.egg-info/requires.txt
  writing src/cryptography.egg-info/PKG-INFO
  writing top-level names to src/cryptography.egg-info/top_level.txt
  writing dependency_links to src/cryptography.egg-info/dependency_links.txt
  writing entry points to src/cryptography.egg-info/entry_points.txt
  warning: manifest_maker: standard file '-c' not found
  reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/_build'
  warning: no previously-included files matching '*' found under directory 'vectors'
  writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-2.6/_padding.c'
  creating build/temp.linux-x86_64-2.6
  generating cffi module 'build/temp.linux-x86_64-2.6/_constant_time.c'
  generating cffi module 'build/temp.linux-x86_64-2.6/_openssl.c'
  building '_openssl' extension
  creating build/temp.linux-x86_64-2.6/build
  creating build/temp.linux-x86_64-2.6/build/temp.linux-x86_64-2.6
  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 -I/usr/include/python2.6 -c build/temp.linux-x86_64-2.6/_openssl.c -o build/temp.linux-x86_64-2.6/build/temp.linux-x86_64-2.6/_openssl.o
  gcc: Internal error: Killed (program cc1)
  Please submit a full bug report.
  See <http://bugzilla.redhat.com/bugzilla> for instructions.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cryptography
  Running setup.py clean for cryptography
Failed to build cryptography
Installing collected packages: cryptography
  Running setup.py install for cryptography ... error
    Complete output from command /root/.local/share/letsencrypt/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-NtR_nB/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-OvGQ8O-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/.local/share/letsencrypt/include/site/python2.6/cryptography:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.6
    creating build/lib.linux-x86_64-2.6/cryptography
    copying src/cryptography/fernet.py -> build/lib.linux-x86_64-2.6/cryptography
    copying src/cryptography/__init__.py -> build/lib.linux-x86_64-2.6/cryptography
    copying src/cryptography/__about__.py -> build/lib.linux-x86_64-2.6/cryptography
    copying src/cryptography/utils.py -> build/lib.linux-x86_64-2.6/cryptography
    copying src/cryptography/exceptions.py -> build/lib.linux-x86_64-2.6/cryptography
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat
    copying src/cryptography/hazmat/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat
    creating build/lib.linux-x86_64-2.6/cryptography/x509
    copying src/cryptography/x509/base.py -> build/lib.linux-x86_64-2.6/cryptography/x509
    copying src/cryptography/x509/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/x509
    copying src/cryptography/x509/general_name.py -> build/lib.linux-x86_64-2.6/cryptography/x509
    copying src/cryptography/x509/extensions.py -> build/lib.linux-x86_64-2.6/cryptography/x509
    copying src/cryptography/x509/oid.py -> build/lib.linux-x86_64-2.6/cryptography/x509
    copying src/cryptography/x509/name.py -> build/lib.linux-x86_64-2.6/cryptography/x509
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings
    copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/backends
    copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends
    copying src/cryptography/hazmat/backends/multibackend.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends
    copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/serialization.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
    copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/openssl
    copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/openssl
    copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/openssl
    copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/openssl
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/commoncrypto
    copying src/cryptography/hazmat/bindings/commoncrypto/binding.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/commoncrypto
    copying src/cryptography/hazmat/bindings/commoncrypto/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/bindings/commoncrypto
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/openssl
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/hmac.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/ciphers.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/hashes.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
    copying src/cryptography/hazmat/backends/commoncrypto/backend.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/backends/commoncrypto
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/interfaces
    copying src/cryptography/hazmat/primitives/interfaces/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/interfaces
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
    copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
    copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
    copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
    copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/twofactor
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
    copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/kdf
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
    copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/asymmetric
    creating build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
    copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
    copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
    copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
    copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-x86_64-2.6/cryptography/hazmat/primitives/ciphers
    running egg_info
    writing requirements to src/cryptography.egg-info/requires.txt
    writing src/cryptography.egg-info/PKG-INFO
    writing top-level names to src/cryptography.egg-info/top_level.txt
    writing dependency_links to src/cryptography.egg-info/dependency_links.txt
    writing entry points to src/cryptography.egg-info/entry_points.txt
    warning: manifest_maker: standard file '-c' not found
    reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files matching '*' found under directory 'vectors'
    writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-2.6/_padding.c'
    creating build/temp.linux-x86_64-2.6
    generating cffi module 'build/temp.linux-x86_64-2.6/_constant_time.c'
    generating cffi module 'build/temp.linux-x86_64-2.6/_openssl.c'
    building '_openssl' extension
    creating build/temp.linux-x86_64-2.6/build
    creating build/temp.linux-x86_64-2.6/build/temp.linux-x86_64-2.6
    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 -I/usr/include/python2.6 -c build/temp.linux-x86_64-2.6/_openssl.c -o build/temp.linux-x86_64-2.6/build/temp.linux-x86_64-2.6/_openssl.o
    gcc: Internal error: Killed (program cc1)
    Please submit a full bug report.
    See <http://bugzilla.redhat.com/bugzilla> for instructions.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/root/.local/share/letsencrypt/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-NtR_nB/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-OvGQ8O-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/.local/share/letsencrypt/include/site/python2.6/cryptography" failed with error code 1 in /tmp/pip-build-NtR_nB/cryptography
You are using pip version 8.0.3, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe we should grep for the strings Killed and allocate memory, and print information suggesting that this might be the problem, and how to fix it, in those cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just recreated the problem on my DO droplet again. On Ubuntu it does not seems to print allocate memory, just Killed.

@pde Should we grep for Killed _or_ allocate memory?


if `echo $PIP_OUT | grep -q Killed` || `echo $PIP_OUT | grep -q "allocate memory"` ; then
echo
echo "Based on your pip output, the problem can likely be fixed by "
echo "increasing the available memory."
else
echo
echo "We were not be able to guess the right solution from your pip "
echo "output."
fi

echo
echo "Consult https://certbot.eff.org/docs/install.html#problems-with-python-virtual-environment"
echo "for possible solutions."
echo "You may also find some support resources at https://certbot.eff.org/support/ ."
fi
rm -rf "$VENV_PATH"
exit 1
Expand Down