datopian / ckanext-blob-storage

CKAN extension to offload blob storage to cloud storage providers (S3, GCS, Azure etc).
http://tech.datopian.com/blob-storage/
MIT License
14 stars 6 forks source link

This package depends on OpenSSL version no longer supported by the OpenSSL project #44

Closed cuducos closed 3 years ago

cuducos commented 3 years ago

pip-installing from requirements.py2.txt' gives this error (surely we can workaround with the suggested env var, but I think it worth it reporting anyway see below):

Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pip._internal import main
  File "/usr/lib/python2.7/site-packages/pip/_internal/__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main_parser.py", line 12, in <module>
    from pip._internal.commands import (
  File "/usr/lib/python2.7/site-packages/pip/_internal/commands/__init__.py", line 6, in <module>
    from pip._internal.commands.completion import CompletionCommand
  File "/usr/lib/python2.7/site-packages/pip/_internal/commands/completion.py", line 6, in <module>
    from pip._internal.cli.base_command import Command
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 18, in <module>
    from pip._internal.download import PipSession
  File "/usr/lib/python2.7/site-packages/pip/_internal/download.py", line 15, in <module>
    from pip._vendor import requests, six, urllib3
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py", line 97, in <module>
    from pip._vendor.urllib3.contrib import pyopenssl
  File "/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/crypto.py", line 17, in <module>
    from OpenSSL._util import (
  File "/usr/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 222, in <module>
    _verify_openssl_version(Binding.lib)
  File "/usr/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 183, in _verify_openssl_version
    "You are linking against OpenSSL 1.0.2, which is no longer "
RuntimeError: You are linking against OpenSSL 1.0.2, which is no longer supported by the OpenSSL project. To use this version of cryptography you need to upgrade to a newer version of OpenSSL. For this version only you can also set the environment variable CRYPTOGRAPHY_ALLOW_OPENSSL_102 to allow OpenSSL 1.0.2.
The command '/bin/sh -c pip install --no-cache-dir -r ckanext-external-storage/requirements.py2.txt' returned a non-zero code: 1
cuducos commented 3 years ago

Actually the CRYPTOGRAPHY_ALLOW_OPENSSL_102 hot-fix suggested earlier just lead to another error:

Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pip._internal import main
  File "/usr/lib/python2.7/site-packages/pip/_internal/__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main_parser.py", line 12, in <module>
    from pip._internal.commands import (
  File "/usr/lib/python2.7/site-packages/pip/_internal/commands/__init__.py", line 6, in <module>
    from pip._internal.commands.completion import CompletionCommand
  File "/usr/lib/python2.7/site-packages/pip/_internal/commands/completion.py", line 6, in <module>
    from pip._internal.cli.base_command import Command
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 18, in <module>
    from pip._internal.download import PipSession
  File "/usr/lib/python2.7/site-packages/pip/_internal/download.py", line 15, in <module>
    from pip._vendor import requests, six, urllib3
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py", line 97, in <module>
    from pip._vendor.urllib3.contrib import pyopenssl
  File "/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/SSL.py", line 149, in <module>
    OP_NO_TLSv1_3 = _lib.SSL_OP_NO_TLSv1_3
AttributeError: 'module' object has no attribute 'SSL_OP_NO_TLSv1_3'
The command '/bin/sh -c pip install --no-cache-dir -r ckanext-external-storage/requirements.py2.txt' returned a non-zero code: 1
shevron commented 3 years ago

What did you do to get this error? I cannot reproduce it locally. Also please provide some details about your OS / system (OS, distribution / version, which Python version and how it was installed etc.).

Also paste the output of:

python -c 'import ssl; print(ssl.OPENSSL_VERSION)'

Most likely, this is not a problem with this package (as in with ckanext-blob-storage or one of it's dependencies) but an issue with your system - your installed version of OpenSSL (or at least the one your Python is trying to dynamically link with at runtime) is too old. OpenSSL is not something our code or even our dependencies link to statically, but dynamically at runtime - the Python ssl module will use whatever OpenSSL version is available to it.

BTW looking at your stack trace I couldn't help but noticing you're not using a virtual environment, so unless this is running in a Docker container or other container of sorts, there is good chance you will encounter many of this sort of compatibility versions over time as you install more and more different versions of stuff into your global Python installation. I'd highly recommend using contained Python environments, probably a virtual environment to run this module.

BTW 2 as a general recommendation when reporting bugs like this that are not trivial or obvious, please include more context information such as what you did to get the error, and some info about your system.

shevron commented 3 years ago

Closing for now, please reopen if you think this is still relevant.