Help: pyopenssl (python-ssl) not installed

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
x3ro
Newbie
Newbie
Posts: 5
Joined: March 1st, 2015, 3:30 pm

Help: pyopenssl (python-ssl) not installed

Post by x3ro »

Hi there,

I just installed SABnzbd on Linux Mint (Ubuntu based) but I can't get SSL to work.
I've installed python-openssl and python3-openssl and I also tried several other things I found via google which I can't remember right now but it always says "pyopenssl (python-ssl) not installed".

I also added the SABnzbd ppa and installed the latest version but it didn't help either.

What can I do to have SSL available? ???
User avatar
sander
Release Testers
Release Testers
Posts: 8830
Joined: January 22nd, 2008, 2:22 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by sander »

So, what is the output of:

Code: Select all

sudo apt-get install python-openssl
Post the full output here
x3ro
Newbie
Newbie
Posts: 5
Joined: March 1st, 2015, 3:30 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by x3ro »

Well it seems to install correctly. After i purged python-openssl this is my output when installing it via apt-get:

Code: Select all

$ sudo apt-get install python-openssl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  python-openssl-doc python-openssl-dbg
The following NEW packages will be installed:
  python-openssl
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/81.5 kB of archives.
After this operation, 427 kB of additional disk space will be used.
Selecting previously unselected package python-openssl.
(Reading database ... 245621 files and directories currently installed.)
Preparing to unpack .../python-openssl_0.13-2ubuntu6_amd64.deb ...
Unpacking python-openssl (0.13-2ubuntu6) ...
Setting up python-openssl (0.13-2ubuntu6) ...

User avatar
sander
Release Testers
Release Testers
Posts: 8830
Joined: January 22nd, 2008, 2:22 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by sander »

So, is it working now in SABnzbd?

What is the output of:

Code: Select all

cat ~/.sabnzbd/logs/sabnzbd.log | grep -i pyopenssl | tail -10
Post the output here.
x3ro
Newbie
Newbie
Posts: 5
Joined: March 1st, 2015, 3:30 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by x3ro »

Code: Select all

$ cat ~/.sabnzbd/logs/sabnzbd.log | grep -i pyopenssl | tail -10
2015-03-05 13:01:30,485::INFO::[sabnzbdplus:490] pyOpenSSL... NOT found - try apt-get install python-pyopenssl (SSL is optional)

# apt-get install python-pyopenssl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python-pyopenssl
Well, that did not work...

I did a quick search and found that python-pyopenssl should be available in the Ubuntu repositories... At least I found this page: https://launchpad.net/ubuntu/+source/pyopenssl

Am I wrong?

BTW: I'm using Linux Mint 17
User avatar
sander
Release Testers
Release Testers
Posts: 8830
Joined: January 22nd, 2008, 2:22 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by sander »

You need python-openssl. See http://packages.ubuntu.com/trusty/sabnzbdplus
So I would say no need for python-pyopenssl

And a "sudo apt-get install sabnzbdplus" should take of it all automagically. So I wonder what is going on on your system

As you show python-openssl is installed, let's check it:

Code: Select all

$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:38)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenSSL
>>>
Post your outpur here.
x3ro
Newbie
Newbie
Posts: 5
Joined: March 1st, 2015, 3:30 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by x3ro »

Well this is what I get:

Code: Select all

$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenSSL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8, in <module>
  File "build/bdist.linux-x86_64/egg/OpenSSL/rand.py", line 11, in <module>
  File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line 3, in <module>
ImportError: No module named cryptography.hazmat.bindings.openssl.binding
>>> 
I did a quick search on the error message but found no solution.

If it is relevant: The package 'python-crypto' is already installed...

Another strange thing is, that I can't even find the files mentioned in the traceback ???
User avatar
jcfp
Release Testers
Release Testers
Posts: 989
Joined: February 7th, 2008, 12:45 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by jcfp »

This reminds me of the search path problem in https://forums.sabnzbd.org/viewtopic.ph ... 435#p97792

The linked post in the other thread has a good code snippet to inspect the python search path. On a standard ubuntu system, anything outside of /usr/lib/ is unusual and should be investigated.
x3ro
Newbie
Newbie
Posts: 5
Joined: March 1st, 2015, 3:30 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by x3ro »

I just had to reinstall my system because my SSD died. I now have installed Linux Mint 17.1 with Cinnamon desktop and now everything works without a problem.

Thanks for your help anyways :)
susron
Newbie
Newbie
Posts: 4
Joined: March 5th, 2016, 2:55 am

Re: Help: pyopenssl (python-ssl) not installed

Post by susron »

If it starts up from the init.d script: SSL fails
on Ubuntu 15.05 startup from systemd: SSL fails

If I run SABnzbd.py --config-file [path to config] from the shell SSL Fails.
if i run /usr/bin/python SABnzbd.py --config-file [path to config] from the shell SSL works.
User avatar
sander
Release Testers
Release Testers
Posts: 8830
Joined: January 22nd, 2008, 2:22 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by sander »

susron wrote: If I run SABnzbd.py --config-file [path to config] from the shell SSL Fails.
if i run /usr/bin/python SABnzbd.py --config-file [path to config] from the shell SSL works.
From the same user account? Interesting.

On which OS?

Could this be a problem with path / environment?

Can you handle the below?

Code: Select all

$ python
Python 2.7.9 (default, Apr  2 2015, 15:33:21) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print (sys.path)
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
>>> 

>>> import OpenSSL
>>> OpenSSL.__file__
'/usr/lib/python2.7/dist-packages/OpenSSL/__init__.pyc'
EDIT:

Also interesting: "python -v"

Code: Select all

$ python -v

>>> 
>>> 
>>> import OpenSSL
import OpenSSL # directory /usr/lib/python2.7/dist-packages/OpenSSL
# /usr/lib/python2.7/dist-packages/OpenSSL/__init__.pyc matches /usr/lib/python2.7/dist-packages/OpenSSL/__init__.py
import OpenSSL # precompiled from /usr/lib/python2.7/dist-packages/OpenSSL/__init__.pyc
import DLFCN # from /usr/lib/python2.7/plat-x86_64-linux-gnu/DLFCN.py
# can't create /usr/lib/python2.7/plat-x86_64-linux-gnu/DLFCN.pyc
dlopen("/usr/lib/python2.7/dist-packages/OpenSSL/crypto.x86_64-linux-gnu.so", 102);
import OpenSSL.crypto # dynamically loaded from /usr/lib/python2.7/dist-packages/OpenSSL/crypto.x86_64-linux-gnu.so
dlopen("/usr/lib/python2.7/dist-packages/OpenSSL/rand.x86_64-linux-gnu.so", 2);
import OpenSSL.rand # dynamically loaded from /usr/lib/python2.7/dist-packages/OpenSSL/rand.x86_64-linux-gnu.so
dlopen("/usr/lib/python2.7/dist-packages/OpenSSL/SSL.x86_64-linux-gnu.so", 2);
import OpenSSL.SSL # dynamically loaded from /usr/lib/python2.7/dist-packages/OpenSSL/SSL.x86_64-linux-gnu.so
# /usr/lib/python2.7/dist-packages/OpenSSL/version.pyc matches /usr/lib/python2.7/dist-packages/OpenSSL/version.py
import OpenSSL.version # precompiled from /usr/lib/python2.7/dist-packages/OpenSSL/version.pyc
>>> 
susron
Newbie
Newbie
Posts: 4
Joined: March 5th, 2016, 2:55 am

Re: Help: pyopenssl (python-ssl) not installed

Post by susron »

yeah weird ...

Ubuntu 15.10 64bit Desktop

Code: Select all

python
Python 2.7.9 (default, Apr  2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/stephen/.local/lib/python2.7/site-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']

exit()
--------------------------------------------

Code: Select all

python -v

import OpenSSL.SSL # dynamically loaded from /usr/lib/python2.7/dist-packages/OpenSSL/SSL.x86_64-linux-gnu.so
................
import DLFCN # precompiled from /usr/lib/python2.7/plat-x86_64-linux-gnu/DLFCN.pyc
----------------
import OpenSSL.crypto # dynamically loaded from /usr/lib/python2.7/dist-packages/OpenSSL/crypto.x86_64-linux-gnu.so
User avatar
sander
Release Testers
Release Testers
Posts: 8830
Joined: January 22nd, 2008, 2:22 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by sander »

Remarks:

1) please put code / output blocks into ... code blocks. It makes reading easier. I have done it for you in your post
2) the code / output blocks above are in the 'correct' config?
3) in the "python -v" I don't see the "import OpenSSL" command? And less output than on my Ubuntu?

The steps ahead:
4) can you find SABnzbd.py?
5) Wait ... if you have SABnzbd.py: how did you install sabnzbd?
6) do you think you can edit SABnzbd.py with a few lines of code if I gave you those lines?
susron
Newbie
Newbie
Posts: 4
Joined: March 5th, 2016, 2:55 am

Re: Help: pyopenssl (python-ssl) not installed

Post by susron »

Ahh .. sorry let me be clearer, I was testing 1.0.0RC2 but the problems are the same, I will revert to sabnzbdplus from apt 0.7.20-1

App stared from init.d ... but python code below from user shell.

Code: Select all

systemctl start sabnzbdplus (calling init.d script)
/usr/bin/python -OO /usr/bin/sabnzbdplus --daemon --pidfile /var/run/sabnzbdplus/pid --config-file /home/xxxxx/.sabnzbd/sabnzbd.ini --server 0.0.0.0:8085

LOG:
2016-03-06 10:13:00,617::INFO::[__init__:335] All processes started
2016-03-06 10:13:00,618::INFO::[sabnzbdplus:336] Web dir is /usr/share/sabnzbdplus/interfaces/Plush
2016-03-06 10:13:00,618::INFO::[sabnzbdplus:336] Web dir is /usr/share/sabnzbdplus/interfaces/Config
2016-03-06 10:13:00,641::INFO::[sabnzbdplus:452] _yenc module... found!
2016-03-06 10:13:00,641::INFO::[sabnzbdplus:460] par2 binary... found (/usr/bin/par2)
2016-03-06 10:13:00,642::INFO::[sabnzbdplus:468] unrar binary... found (/usr/bin/unrar)
2016-03-06 10:13:00,642::INFO::[sabnzbdplus:473] unzip binary... found (/usr/bin/unzip)
2016-03-06 10:13:00,642::INFO::[sabnzbdplus:479] nice binary... found (/usr/bin/nice)
2016-03-06 10:13:00,642::INFO::[sabnzbdplus:483] ionice binary... found (/usr/bin/ionice)
2016-03-06 10:13:00,642::INFO::[sabnzbdplus:490] pyOpenSSL... NOT found - try apt-get install python-pyopenssl (SSL is optional)
2016-03-06 10:13:00,644::INFO::[sabnzbdplus:1516] Starting web-interface on 0.0.0.0:8085


Python 2.7.9 (default, Apr  2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print (sys.path)
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
>>> import OpenSSL
>>> OpenSSL.__file__
'/usr/lib/python2.7/dist-packages/OpenSSL/__init__.pyc'

python -v

>>>
>>>
>>> import OpenSSL
import OpenSSL # directory /usr/lib/python2.7/dist-packages/OpenSSL
# /usr/lib/python2.7/dist-packages/OpenSSL/__init__.pyc matches /usr/lib/python2.7/dist-packages/OpenSSL/__init__.py
import OpenSSL # precompiled from /usr/lib/python2.7/dist-packages/OpenSSL/__init__.pyc
# /usr/lib/python2.7/plat-x86_64-linux-gnu/DLFCN.pyc matches /usr/lib/python2.7/plat-x86_64-linux-gnu/DLFCN.py
import DLFCN # precompiled from /usr/lib/python2.7/plat-x86_64-linux-gnu/DLFCN.pyc
dlopen("/usr/lib/python2.7/dist-packages/OpenSSL/crypto.x86_64-linux-gnu.so", 102);
import OpenSSL.crypto # dynamically loaded from /usr/lib/python2.7/dist-packages/OpenSSL/crypto.x86_64-linux-gnu.so
dlopen("/usr/lib/python2.7/dist-packages/OpenSSL/rand.x86_64-linux-gnu.so", 2);
import OpenSSL.rand # dynamically loaded from /usr/lib/python2.7/dist-packages/OpenSSL/rand.x86_64-linux-gnu.so
dlopen("/usr/lib/python2.7/dist-packages/OpenSSL/SSL.x86_64-linux-gnu.so", 2);
import OpenSSL.SSL # dynamically loaded from /usr/lib/python2.7/dist-packages/OpenSSL/SSL.x86_64-linux-gnu.so
# /usr/lib/python2.7/dist-packages/OpenSSL/version.pyc matches /usr/lib/python2.7/dist-packages/OpenSSL/version.py
import OpenSSL.version # precompiled from /usr/lib/python2.7/dist-packages/OpenSSL/version.pyc



And I can certainly handle some code changes, please let me know if you would prefer I stay with 0.7...

and a big thanks for the help.
User avatar
sander
Release Testers
Release Testers
Posts: 8830
Joined: January 22nd, 2008, 2:22 pm

Re: Help: pyopenssl (python-ssl) not installed

Post by sander »

Let me quote what you said earlier:
susron wrote: If I run SABnzbd.py --config-file [path to config] from the shell SSL Fails.
if i run /usr/bin/python SABnzbd.py --config-file [path to config] from the shell SSL works.
Is that still true? So: from the command line (not from within a script), with exact those commands?

Because what you just posted is quite something else: from a script (?), and /usr/bin/sabnzbdplus.

And please answer question 5)
Post Reply