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

SSL issue with pip pysbol package on Linux #202

Open
tim-tx opened this issue Aug 1, 2018 · 7 comments
Open

SSL issue with pip pysbol package on Linux #202

tim-tx opened this issue Aug 1, 2018 · 7 comments

Comments

@tim-tx
Copy link

tim-tx commented Aug 1, 2018

Python 2 and 3 affected (2.7 and 3.6 tested).

Steps to reproduce:

$ pip install pysbol --user
$ python
>>> from sbol import *
>>> partshop = PartShop('https://synbiohub.org/public/igem')
>>> records = partshop.search('interlab')

Result:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/me/.local/lib/python3.6/site-packages/sbol/libsbol.py", line 8643, in search
    val = _libsbol.PartShop_search(self, *args)
RuntimeError: Attempt to validate online failed with Problem with the SSL CA cert (path? access rights?)

The above steps work against pysbol built manually from the libSBOL source.

@bbartley
Copy link
Contributor

bbartley commented Aug 2, 2018

Hi Tim,

I've attempted to correct this issue by recompiling libpython with OpenSSL and deploying a new wheel.

At your convenience, please update to the new wheel and re-test with Python3.6.

$ pip install --user --upgrade

This should upgrade your package to pySBOL-2.3.0.post20-cp36-cp36m-manylinux1_x86_64.whl

@tim-tx
Copy link
Author

tim-tx commented Aug 2, 2018

Here is the result:

Python 3.6.6 (default, Jun 27 2018, 13:11:40) 
[GCC 8.1.1 20180531] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sbol
Traceback (most recent call last):
  File "/home/tsj/.local/lib/python3.6/site-packages/sbol/libsbol.py", line 19, in swig_import_helper
return importlib.import_module(mname)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /home/tsj/.local/lib/python3.6/site-packages/sbol/_libsbol.so: undefined symbol: MD5_Init

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tsj/.local/lib/python3.6/site-packages/sbol/__init__.py", line 6, in <module>
from sbol.sbol import *
  File "/home/tsj/.local/lib/python3.6/site-packages/sbol/sbol.py", line 17, in <module>
from .libsbol import *
  File "/home/tsj/.local/lib/python3.6/site-packages/sbol/libsbol.py", line 22, in <module>
_libsbol = swig_import_helper()
  File "/home/tsj/.local/lib/python3.6/site-packages/sbol/libsbol.py", line 21, in swig_import_helper
return importlib.import_module('_libsbol')
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_libsbol'

@bbartley
Copy link
Contributor

@tim-tx Hi Tim, I've made another attempt at building the Linux wheel with support for secure HTTP:

At your convenience, please update to the new wheel and test with Python3.6.

$ pip install --user --upgrade

This should upgrade your package to pySBOL-2.3.0.post21-cp36-cp36m-manylinux1_x86_64.whl

@tim-tx
Copy link
Author

tim-tx commented Aug 26, 2018

@bbartley Hi Bryan, I did the upgrade, though I seem to be running into the same issue:

$ python3.6 -m pip show pysbol
Name: pySBOL
Version: 2.3.0.post21
...

And then:

$ python3.6                 
Python 3.6.6 (default, Aug 26 2018, 01:20:38) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sbol import *
Traceback (most recent call last):
  File "/home/lab/.local/lib/python3.6/site-packages/sbol/libsbol.py", line 19, in swig_import_helper
return importlib.import_module(mname)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /home/lab/.local/lib/python3.6/site-packages/sbol/_libsbol.so: undefined symbol: MD5_Init

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lab/.local/lib/python3.6/site-packages/sbol/__init__.py", line 6, in <module>
from sbol.sbol import *
  File "/home/lab/.local/lib/python3.6/site-packages/sbol/sbol.py", line 17, in <module>
from .libsbol import *
  File "/home/lab/.local/lib/python3.6/site-packages/sbol/libsbol.py", line 22, in <module>
_libsbol = swig_import_helper()
  File "/home/lab/.local/lib/python3.6/site-packages/sbol/libsbol.py", line 21, in swig_import_helper
return importlib.import_module('_libsbol')
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_libsbol'

@bbartley
Copy link
Contributor

bbartley commented Oct 8, 2019

Hi, the latest version of pySBOL now has a workaround for this issue. Before sending a request to synbiohub, you can configure the certificate path for your Linux distribution, as follows:

Config.setOption('ca-path', path_to_ca_file)

Where path_to_ca_file is defined as follows for different Linux distros:
Debian/Ubuntu: "/etc/ssl/certs/ca-certificates.crt"
Fedora/RHEL: "/etc/pki/tls/certs/ca-bundle.crt"
OpenSUSE : "/var/lib/ca-certificates/ca-bundle.pem"

By default the certificate path is configured for Red Hat Linux

@tim-tx
Copy link
Author

tim-tx commented Oct 23, 2019

Can you deploy a Linux / Python 3.7 wheel for pySBOL-2.3.2? If I can get a wheel for this I'm happy to test. I wonder if there isn't some appropriate abstraction layer that can tell you where to look, that could be used instead of this workaround in the future? As I remember I did not have any SSL issues when I built the Python bindings from libSBOL directly.

@bbartley
Copy link
Contributor

@tim-tx There is now a Python 3.7 wheel available for Linux that should auto-configure the certificate path. It seems to work on Ubuntu and CentOS so far:

pip3 install pysbol --upgrade --user

You should get:
Successfully installed pysbol-2.3.3.post6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants