Bug 1471360 - AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'
AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: pyOpenSSL (Show other bugs)
26
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tomas Mraz
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-15 05:19 EDT by Marcin Juszkiewicz
Modified: 2017-07-17 12:37 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-17 12:37:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marcin Juszkiewicz 2017-07-15 05:19:10 EDT
Description of problem:

I can not run virt-manager under Fedora 26.


Version-Release number of selected component (if applicable):

python2-pyOpenSSL-16.2.0-4.fc26.noarch

How reproducible:

always

Steps to Reproduce:
1. dnf install virt-manager
2. virt-manager


Actual results:

11:11 hrw@puchatek:tv$ virt-manager 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager", line 33, in <module>
    from virtinst import util as util
  File "/usr/share/virt-manager/virtinst/__init__.py", line 89, in <module>
    from virtinst.distroinstaller import DistroInstaller
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 23, in <module>
    from . import urlfetcher
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 34, in <module>
    import requests
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 52, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/lib/python2.7/site-packages/requests/packages/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 rand, crypto, SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/SSL.py", line 112, in <module>
    if _lib.Cryptography_HAS_SSL_ST:
AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'


Expected results:

virt-manager runs

Additional info:

11:13 hrw@puchatek:tv$ rpm -qf /usr/lib/python2.7/site-packages/OpenSSL/SSL.py
python2-pyOpenSSL-16.2.0-4.fc26.noarch
Comment 1 Tomas Mraz 2017-07-17 04:51:05 EDT
Can you please try packages from https://koji.fedoraproject.org/koji/buildinfo?buildID=919273 if they solve your problem?
Comment 2 Marcin Juszkiewicz 2017-07-17 08:06:07 EDT
Same issue ;(


14:04 hrw@puchatek:~$ virt-manager
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager", line 33, in <module>
    from virtinst import util as util
  File "/usr/share/virt-manager/virtinst/__init__.py", line 89, in <module>
    from virtinst.distroinstaller import DistroInstaller
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 23, in <module>
    from . import urlfetcher
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 34, in <module>
    import requests
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 52, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/lib/python2.7/site-packages/requests/packages/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 rand, crypto, SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/SSL.py", line 115, in <module>
    if _lib.Cryptography_HAS_SSL_ST:
AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'

14:05 hrw@puchatek:~$ rpm -qf /usr/lib/python2.7/site-packages/OpenSSL/SSL.py
python2-pyOpenSSL-17.1.0-1.fc26.noarch
Comment 3 Tomas Mraz 2017-07-17 09:19:18 EDT
What is your installed python-cryptography version?
Do you have the current package installed?
Comment 4 Marcin Juszkiewicz 2017-07-17 11:07:12 EDT
17:06 root@puchatek:hrw# LANGUAGE=C dnf list python*crypto* python*ssl*
Last metadata expiration check: 0:00:34 ago on pon, 17 lip 2017, 17:06:10.
Installed Packages
python-backports-ssl_match_hostname.noarch    3.5.0.1-4.fc26       @fedora      
python2-crypto.x86_64                         2.6.1-14.fc26        @fedora      
python2-cryptography.x86_64                   1.7.2-1.fc26         @fedora      
python2-passlib.noarch                        1.7.0-4.fc26         @fedora      
python2-pyOpenSSL.noarch                      17.1.0-1.fc26        @@commandline
python3-cryptography.x86_64                   1.7.2-1.fc26         @fedora      
python3-pyOpenSSL.noarch                      17.1.0-1.fc26        @@commandline
Available Packages
python-cryptominisat4.x86_64                  4.5.3-8.fc26         fedora       
python-jwcrypto.noarch                        0.3.2-3.fc26         fedora       
python-rsslib.noarch                          0-8.20130310.fc26    fedora       
python2-cryptography-vectors.noarch           1.7.2-1.fc26         fedora       
python2-zope-processlifetime.noarch           2.1.0-3.fc26         fedora       
python3-crypto.x86_64                         2.6.1-14.fc26        fedora       
python3-cryptography-vectors.noarch           1.7.2-1.fc26         fedora       
python3-jwcrypto.noarch                       0.3.2-3.fc26         fedora       
python3-passlib.noarch                        1.7.0-4.fc26         fedora       
python3-zope-processlifetime.noarch           2.1.0-3.fc26         fedora
Comment 5 Tomas Mraz 2017-07-17 12:12:29 EDT
This is really strange - I cannot reproduce the problem with these packages here.

It looks like you have some third party copy of old version of python-cryptography present or something like that.

Can you reproduce the problem if you run
 python -c 'import requests'
Comment 6 Marcin Juszkiewicz 2017-07-17 12:37:46 EDT
18:34 hrw@puchatek:~$ python -c 'import requests'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 52, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/lib/python2.7/site-packages/requests/packages/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 rand, crypto, SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/SSL.py", line 115, in <module>
    if _lib.Cryptography_HAS_SSL_ST:
AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'
18:35 hrw@puchatek:~$ sudo python -c 'import requests'
18:35 hrw@puchatek:~$ 

Looks like local issue. 

some minutes later after strace session...

rm -rf ~/.local/lib/python2.7/

works now.

Note You need to log in before you can comment on or make changes to this bug.