Sickrage python upgrade

Status
Not open for further replies.

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
I'm not using the plugin. Rather, I've just installed a jail to then installed various pvr apps. I run them all in one jail.

Then I install from the github repos.

I just tried to re-install a fresh python compiled from source, but I still get the same error, even though now I get this:
root@pvrapps:/usr/local/share/Python-2.7.12 # python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.0.2h 3 May 2016


I saved the old /usr/bin/python binary before I ran make install, but now I fear that I should have done more.

The exact error I'm getting is this:
root@pvrapps:/usr/local/share/Python-2.7.12 # service sickrage restart
sickrage not running? (check /var/run/sickrage/sickrage.pid).
Starting sickrage.
Traceback (most recent call last):
File "/usr/local/share/SickRage/SickBeard.py", line 94, in <module>
import sickbeard
File "/usr/local/share/SickRage/sickbeard/__init__.py", line 39, in <module>
from sickbeard.indexers import indexer_api
File "/usr/local/share/SickRage/sickbeard/indexers/__init__.py", line 21, in <module>
from . import indexer_api
File "/usr/local/share/SickRage/sickbeard/indexers/indexer_api.py", line 26, in <module>
from indexer_config import initConfig
File "/usr/local/share/SickRage/sickbeard/indexers/indexer_config.py", line 3, in <module>
from tvdb_api.tvdb_api import Tvdb
File "/usr/local/share/SickRage/lib/tvdb_api/tvdb_api.py", line 24, in <module>
import requests
File "/usr/local/share/SickRage/lib/requests/__init__.py", line 53, in <module>
from .packages.urllib3.contrib import pyopenssl
File "/usr/local/share/SickRage/lib/requests/packages/urllib3/contrib/pyopenssl.py", line 54, in <module>
import OpenSSL.SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/rand.py", line 12, in <module>
from OpenSSL._util import (
File "/usr/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 250, in <module>
_verify_openssl_version(Binding.lib.SSLeay())
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 230, in _verify_openssl_version
"You are linking against OpenSSL 0.9.8, which is no longer "
RuntimeError: You are linking against OpenSSL 0.9.8, which is no longer support by the OpenSSL project. You need to upgrade to a newer version of OpenSSL.
/usr/local/etc/rc.d/sickrage: WARNING: failed to start sickrage
r
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm not using the plugin. Rather, I've just installed a jail to then installed various pvr apps. I run them all in one jail.

Then I install from the github repos.

I just tried to re-install a fresh python compiled from source, but I still get the same error, even though now I get this:
root@pvrapps:/usr/local/share/Python-2.7.12 # python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.0.2h 3 May 2016


I saved the old /usr/bin/python binary before I ran make install, but now I fear that I should have done more.

The exact error I'm getting is this:
root@pvrapps:/usr/local/share/Python-2.7.12 # service sickrage restart
sickrage not running? (check /var/run/sickrage/sickrage.pid).
Starting sickrage.
Traceback (most recent call last):
File "/usr/local/share/SickRage/SickBeard.py", line 94, in <module>
import sickbeard
File "/usr/local/share/SickRage/sickbeard/__init__.py", line 39, in <module>
from sickbeard.indexers import indexer_api
File "/usr/local/share/SickRage/sickbeard/indexers/__init__.py", line 21, in <module>
from . import indexer_api
File "/usr/local/share/SickRage/sickbeard/indexers/indexer_api.py", line 26, in <module>
from indexer_config import initConfig
File "/usr/local/share/SickRage/sickbeard/indexers/indexer_config.py", line 3, in <module>
from tvdb_api.tvdb_api import Tvdb
File "/usr/local/share/SickRage/lib/tvdb_api/tvdb_api.py", line 24, in <module>
import requests
File "/usr/local/share/SickRage/lib/requests/__init__.py", line 53, in <module>
from .packages.urllib3.contrib import pyopenssl
File "/usr/local/share/SickRage/lib/requests/packages/urllib3/contrib/pyopenssl.py", line 54, in <module>
import OpenSSL.SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/rand.py", line 12, in <module>
from OpenSSL._util import (
File "/usr/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 250, in <module>
_verify_openssl_version(Binding.lib.SSLeay())
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 230, in _verify_openssl_version
"You are linking against OpenSSL 0.9.8, which is no longer "
RuntimeError: You are linking against OpenSSL 0.9.8, which is no longer support by the OpenSSL project. You need to upgrade to a newer version of OpenSSL.
/usr/local/etc/rc.d/sickrage: WARNING: failed to start sickrage
r
ahh, well this is the plugin section so I assumed the plugin. to compile correctly you need to have openssl 1.0.1e or later, and set a make.conf variable to use openssl fro ports.

if the programs you use are plugins, you can install multiple plugins to the same jail, then i you don't need to think about getting the right dependencies.
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
Oops ... didn't notice that it was the plugin section.

When I first used plugins (+year ago), it looked like they each wanted their own jail, and I didn't like that.

I have the latest openssl (from pkg install), but I'm not finding a make.conf in the source tree. I would have thought that

./configure CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib --with-openssl

would have done it. And again, according to this I should be set:

root@pvrapps:/usr/local/share/Python-2.7.12 # python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.0.2h 3 May 2016


 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
you can upload additional PBIs to a plugin jail on the jails tab. the file is /etc/make.conf
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
OK, if I have to start over again I'll do that. But it feels like I'm really close ... can you tell me what my configure options should be and what I need to add to make.conf?

root@pvrapps:/usr/local/share/Python-2.7.12 # cat /etc/make.conf
WITH_PKGNG=yes
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
OK, if I have to start over again I'll do that. But it feels like I'm really close ... can you tell me what my configure options should be and what I need to add to make.conf?

root@pvrapps:/usr/local/share/Python-2.7.12 # cat /etc/make.conf
WITH_PKGNG=yes
WITH_OPENSSL_PORT=yes
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
Great ... getting closer. I think it's just down to configure options now:

root@pvrapps:/usr/local/share/Python-2.7.12 # ./configure --with-pydebug --with-pth --with-wctype-functions && make -j2 && make install

root@pvrapps:/usr/local/share/Python-2.7.12 # service sickrage restart
sickrage not running? (check /var/run/sickrage/sickrage.pid).
Starting sickrage.
Assertion failed: (type->tp_dict != NULL), function PyType_Ready, file Objects/typeobject.c, line 4045.
Abort
/usr/local/etc/rc.d/sickrage: WARNING: failed to start sickrage
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Great ... getting closer. I think it's just down to configure options now:

root@pvrapps:/usr/local/share/Python-2.7.12 # ./configure --with-pydebug --with-pth --with-wctype-functions && make -j2 && make install

root@pvrapps:/usr/local/share/Python-2.7.12 # service sickrage restart
sickrage not running? (check /var/run/sickrage/sickrage.pid).
Starting sickrage.
Assertion failed: (type->tp_dict != NULL), function PyType_Ready, file Objects/typeobject.c, line 4045.
Abort
/usr/local/etc/rc.d/sickrage: WARNING: failed to start sickrage
what the heck are you doing? Why aren't you installing python2.7 from ports?
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
Well, I did (pkg install python27-2.7.12) but it's using an older openssl.

The only thing I could find was to re-compile from source.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Well, I did (pkg install python27-2.7.12) but it's using an older openssl.

The only thing I could find was to re-compile from source.
To compile python2.7 from source you should use the FreeBSD port.
Code:
pkg delete python2.7
cd /usr/ports/lang/python27
make install clean
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
Yea, but then it wants to remove a whole bunch of stuff that will just make things worse I think. I think it might break everything.

root@pvrapps:/usr/ports/sysutils # pkg delete python27-2.7.12
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 45 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
python27-2.7.12
nzbget-16.4_3
py27-enum34-1.1.6
py27-openssl-16.0.0
py27-cffi-1.7.0
py27-twistedCore-15.2.1
py27-lxml-3.6.0
py27-cryptography-1.4
py27-twistedWeb-15.2.1
py27-zope.interface-4.1.3
python2-2_3
py27-pyasn1-modules-0.0.8_1
py27-pip-8.0.2
llvm36-3.6.2_2
llvm37-3.7.1_2
python-2.7_2,2
py27-pyasn1-0.1.9
py27-pycparser-2.10
py27-setuptools27-23.1.0
py27-six-1.10.0
py27-attrs-16.0.0
py27-service_identity-16.0.0
py27-sqlite3-2.7.12_7
py27-sslstrip-0.9_1
py27-idna-2.0
py27-ipaddress-1.0.16
py27-ranger-1.7.2
py27-characteristic-14.3.0
glib-2.46.2_2
libEGL-11.2.2
qt5-gui-5.5.1_1
desktop-file-utils-0.22_3
qt5-core-5.5.1_2
cairo-1.14.6_1,2
harfbuzz-1.3.0
shared-mime-info-1.5
qt5-widgets-5.5.1_1
qt5-quick-5.5.1
mkvtoolnix-8.8.0
qt5-network-5.5.1
qt5-sql-5.5.1
qt5-qml-5.5.1
qt5-dbus-5.5.1
qt5-testlib-5.5.1
qt5-xmlpatterns-5.5.1
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Yea, but then it wants to remove a whole bunch of stuff that will just make things worse I think. I think it might break everything.

root@pvrapps:/usr/ports/sysutils # pkg delete python27-2.7.12
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 45 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
python27-2.7.12
nzbget-16.4_3
py27-enum34-1.1.6
py27-openssl-16.0.0
py27-cffi-1.7.0
py27-twistedCore-15.2.1
py27-lxml-3.6.0
py27-cryptography-1.4
py27-twistedWeb-15.2.1
py27-zope.interface-4.1.3
python2-2_3
py27-pyasn1-modules-0.0.8_1
py27-pip-8.0.2
llvm36-3.6.2_2
llvm37-3.7.1_2
python-2.7_2,2
py27-pyasn1-0.1.9
py27-pycparser-2.10
py27-setuptools27-23.1.0
py27-six-1.10.0
py27-attrs-16.0.0
py27-service_identity-16.0.0
py27-sqlite3-2.7.12_7
py27-sslstrip-0.9_1
py27-idna-2.0
py27-ipaddress-1.0.16
py27-ranger-1.7.2
py27-characteristic-14.3.0
glib-2.46.2_2
libEGL-11.2.2
qt5-gui-5.5.1_1
desktop-file-utils-0.22_3
qt5-core-5.5.1_2
cairo-1.14.6_1,2
harfbuzz-1.3.0
shared-mime-info-1.5
qt5-widgets-5.5.1_1
qt5-quick-5.5.1
mkvtoolnix-8.8.0
qt5-network-5.5.1
qt5-sql-5.5.1
qt5-qml-5.5.1
qt5-dbus-5.5.1
qt5-testlib-5.5.1
qt5-xmlpatterns-5.5.1
pkg delete -f python27
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
ok, I thought that would force remove deps. Anyway, next problem is this:

root@pvrapps:/usr/ports/lang/python27 # make install clean
"/usr/ports/Mk/bsd.port.mk", line 1194: UNAME_r (10.3-STABLE) and OSVERSION (903000) do not agree on major version number.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
ok, I thought that would force remove deps. Anyway, next problem is this:

root@pvrapps:/usr/ports/lang/python27 # make install clean
"/usr/ports/Mk/bsd.port.mk", line 1194: UNAME_r (10.3-STABLE) and OSVERSION (903000) do not agree on major version number.
I have gotten around this issue before, but I don't remember how. There's probably a config file somewhere that defines the OS version for the jail, or you can possible run the 'make' command with a flag to override the OS version.

Was this jail installed on FreeNAS 9.3, then you upgraded to FreeNAS 9.10?

None of this would be an issue with the plugin, lol.
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
yep 9.3 to 9.10.

OK. I'm done. Going to bed. Will install plugin(s) tomorrow. lol

Thanks for the help.
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
Now I'm really stuck. I can't install any plugin. I get a message that the template is missing, and while there is no template named pluginjail, when I try to add it I can't because freenas thinks it already exists in some sqlite db.

And then there's this:
[bill@freenas] /mnt/z1/jails# ll
total 177
drwxr-xr-x 13 root wheel 13 Apr 6 14:18 ./
drwxr-xr-x 13 root wheel 13 Jan 15 2016 ../
drwxr-xr-x 2 root wheel 17 Jan 30 2016 .plex.meta/
drwxr-xr-x 3 www www 3 Oct 25 2015 .plugins/
drwxr-xr-x 2 root wheel 19 Jan 31 2016 .pvr.meta/
drwxr-xr-x 2 root wheel 17 Jan 30 2016 .pvrapps.meta/
drwxr-xr-x 5 root wheel 5 Oct 21 2015 .warden-files-cache/
drwxr-xr-x 2 root wheel 2 Oct 25 2015 .warden-template-pluginjail/
drwxr-xr-x 17 root wheel 21 Oct 24 2015 .warden-template-standard-9.3-RELEASE/
drwxr-xr-x 17 root wheel 21 Jan 30 2016 .warden-template-standard-9.3-x64/
drwxr-xr-x 17 root wheel 22 Jan 30 2016 plex/
drwxr-xr-x 19 root wheel 24 Jan 19 2016 pvr/
drwxr-xr-x 17 root wheel 22 Jan 30 2016 pvrapps/
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
hmm over my head, guess your upgrade from 9.3 didn't go too cleanly.

if you don't have any jails you care about you might be safe to delete your jails dataset but I'm not sure =\
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
[bill@freenas] /mnt/z1/jails# warden template delete pluginjail
ERROR: Not a ZFS volume: /mnt/z1/jails/.warden-template-pluginjail
cannot open 'z1/jails/.warden-template-pluginjail': dataset does not exist
 

Bill McCormick

Explorer
Joined
Oct 3, 2015
Messages
68
Used warden template delete, then create and it got things fixed. Now can install plugins again.
 

epicnas

Cadet
Joined
Oct 6, 2016
Messages
4
I managed to solve OP's problem (I was suffering from the same error message).
  1. I installed the new openssl:
    pkg update
    pkg install openssl
  2. Then to build python from source (not sure i need this see step 3,however this might come in handy in other situations if you want to build ports..) I needed to edit /etc/login.conf from
    Code:
    default:\
    		:passwd_format=sha512:\
    		:copyright=/etc/COPYRIGHT:\
    		:welcome=/etc/motd:\
    		:setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\
    		:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\
    

    to
    Code:
    default:\
    		:passwd_format=sha512:\
    		:copyright=/etc/COPYRIGHT:\
    		:welcome=/etc/motd:\
    		:setenv=UNAME_r=9.3-RELEASE,MAIL=/var/mail/$,BLOCKSIZE=K:\
    		:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\
    

    (P.S. it is "UNAME_r" with a lowercase r for some reason, this also fooled me a while)
    then you can rebuild python27
    cd /usr/ports/lang/python27 ; pkg delete -f python27 ; make clean install
  3. This last step made me work a bit, urllib which uses py-cryptography still linked to a old openssl (living in /lib/ i think..? as opposed to the new openssl which is in /usr/local/lib)
    however rebuilding the cryptography package of python seems to help, you need to install pip first though:
    easy_install pip
    then use pip to reinstall cryptography
    LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" LD_LIBRARY_PATH=/usr/local/lib pip install --upgrade cryptography
 
Status
Not open for further replies.
Top