I'm not sure this is a problem in cryptography, but I think it might be related.
Over the past few days, I've had problems with my Apache 2.4.23 server, where it failed to correctly serve HTML files from disk over HTTPS. Restarting it solves the problem temporarily.
This Apache installation makes use of mod_wsgi (with Python 2.7.10) to run a number of WSGI applications, some of which use cryptography. In the Apache error logs, I found a lot of messages like this:
extern "Python": function Cryptography_rand_bytes() called, but @ffi.def_extern() was not called in the current subinterpreter. Returning 0.
extern "Python": function Cryptography_rand_status() called, but @ffi.def_extern() was not called in the current subinterpreter. Returning 0.
I somewhat recently upgraded from cryptography 1.3.4 to 1.5.2, so this might be related.
Any suggestions on what might be wrong here?
Yep this is a cryptography issue. It will be resolved when we merge #3229 (which will happen hopefully soon-ish and release as part of 1.7 in 2-3 weeks).
You can stop the error msg by using a single global instance in mod_wsgi rather than subinterpreters by setting WSGIApplicationGroup to %{GLOBAL}, but that may not be practical for your situation.
(Resolved by 1.7)
Is this in a released version or still only in HEAD?
It's in 1.7+, which was released last month.
But I still get the annoying error:
extern "Python": function Cryptography_rand_status() called, but @ffi.def_extern() was not called in the current subinterpreter. Returning 0.
Running Ubuntu 16.04 LTS, Kodi 17.0 - but the error was with Kodi 16.1 as well
@krogsbell You are not running cryptography 1.7. Either your system or Kodi use an old version of cryptography.
Right I was running 1.2.3
With these two commands:
sudo pip install --upgrade pip
sudo pip install cryptography --upgrade
I get:
Successfully installed appdirs-1.4.0 cffi-1.9.1 cryptography-1.7.2 enum34-1.1.6 idna-2.2 ipaddress-1.0.18 packaging-16.8 pyasn1-0.2.2 pycparser-2.17 pyparsing-2.1.10 setuptools-34.2.0
But testing with:
apt-cache policy python-cryptography python-openssl
I still get:
python-cryptography:
Installed: 1.2.3-1ubuntu0.1
Candidate: 1.2.3-1ubuntu0.1
Will a reboot solve this?
Removing python 2.7 - No good idea - Kodi do not run without ;-(
Also experiencing this problem with Kodi while not having 1.7 available. Is there any solution to upgrading the package on Ubuntu 16.10?
You can install the package from Ubuntu Zesty https://launchpad.net/ubuntu/zesty/amd64/python-cryptography/1.7.1-2 no conflicts and seems to work just fine
Work for me update cryptography!
sudo pip install cryptography --upgrade
installed kodi from ppa in ubuntu 16.04.4 and got the above error.
sudo apt install python-pip
pip install --upgrade pip
pip install cryptography --upgrade
did the job for me
EDIT:
little off topic but in case someone gets here because of kodi:
to get the youtube addon running do:
pip install --upgrade pyopenssl
I run in all this problems and solutions...
I had to launch
sudo apt install --reinstall python-openssl
to correct
Error Contents: 'module' object has no attribute 'SSL_ST_INIT'
Knowledge sharing is wonderful
Most helpful comment
Work for me update cryptography!
sudo pip install cryptography --upgrade