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

CRASH after update #153

Closed
amitkeret opened this issue Mar 12, 2014 · 34 comments
Closed

CRASH after update #153

amitkeret opened this issue Mar 12, 2014 · 34 comments

Comments

@amitkeret
Copy link

Help!

Today I received notice that my installation is 18 commits behind, and performed an update. Usually this goes through with no trouble, this time the daemon failed to restart.
When trying to manually start SickBeard via command line, I get the following:

# python SickBeard.py 
Traceback (most recent call last):
  File "SickBeard.py", line 46, in <module>
    import sickbeard
  File "/root/Apps/sickbeard/sickbeard/__init__.py", line 35, in <module>
    from sickbeard import providers, metadata
  File "/root/Apps/sickbeard/sickbeard/metadata/__init__.py", line 23, in <module>
    import mediabrowser
  File "/root/Apps/sickbeard/sickbeard/metadata/mediabrowser.py", line 25, in <module>
    import generic
  File "/root/Apps/sickbeard/sickbeard/metadata/generic.py", line 40, in <module>
    from sickbeard import subtitle_queue
  File "/root/Apps/sickbeard/sickbeard/subtitle_queue.py", line 30, in <module>
    from lib import subliminal
  File "/root/Apps/sickbeard/lib/subliminal/__init__.py", line 9, in <module>
    from .api import list_subtitles, download_subtitles, download_best_subtitles, save_subtitles
  File "/root/Apps/sickbeard/lib/subliminal/api.py", line 9, in <module>
    from .providers import ProviderPool
  File "/root/Apps/sickbeard/lib/subliminal/providers/__init__.py", line 241
    self.providers = {p: provider_manager[p] for p in (providers or provider_manager.available_providers)}
                                               ^
SyntaxError: invalid syntax
#

According to git, I'm on commit ba9a018.
SickBeard is installed on a RasPi with OpenELEC.

Any thoughts?

@Yellow1144
Copy link

Yeah, I am having the same problem on Win7/64 both with an update and a fresh install of this fork. I wrote about it in more detail here as Yellow11 - http://sickbeard.com/forums/viewtopic.php?f=4&t=5024&p=41278#p41278

If you'd like me to post my details here instead, I'd be happy to

@adoram
Copy link

adoram commented Mar 13, 2014

RESOLVED:
Download setuptools 3.1 from: https://pypi.python.org/pypi/setuptools
Extract from the compressed archive and run easy_setup.py
Restart Sick Beard.

That's it, you're done!

Enjoy, Adoram

@amitkeret
Copy link
Author

@adoram,

There is no file called easy_setup.py
There's "easy_install.py" and "setup.py"
Which one did you mean?

Also, can you explain what this package does? I could not understand from the package description (not very newbie-friendly, IMHO...)

@adoram
Copy link

adoram commented Mar 13, 2014

Sorry about that, it's easy_install.py

@adoram
Copy link

adoram commented Mar 13, 2014

Read all about setuptools at: http://pythonhosted.org//setuptools/

@wolfster
Copy link

Hello,

I also have the same problem.

@adoram Could you maybe give step by step instructions?

I get the error that there is no install script in the sick beard folder.... don´t know if I do something wrong here

MacMini:setuptools-3.1 MacMini$ python easy_install.py /Users/MacMini/Desktop/Sick-Beard-torrent_1080_subtitles.zip
Processing Sick-Beard-torrent_1080_subtitles.zip
error: Couldn't find a setup script in /Users/MacMini/Desktop/Sick-Beard-torrent_1080_subtitles.zip

@Yellow1144
Copy link

Yeah, this is a little confusing to me too. Where do we run Easy_install from? The Python installation, or SickBeard folder. I read that it will live in the Python installation folder and will install certain files there, which has happened on my system. easy_install wants a URL or a file. Do we point it at SickBeard.py? or is it something that lives in the Python installation? Lots of questions. (Sadly, I'm not a programmer but know my systems inside and out.) But really, what easy_install or setuptools is isn't really clear. Are we using it for sickbeard here specifically or for Python in general. I'm still reading.

@VeNoMouS
Copy link

Sorry guys, are you all using subtitle branch? or are you using torrentProviders too? as this appears to be only related to the subtitle branch judging by the "subliminal" references...

smacks @junalmeida hand

@wolfster
Copy link

I use the torrent_1080_subtitlea branch....

I wonder why only so few people have problems here....

@Yellow1144
Copy link

Well, the outright crash I am experiencing with the 1080_subtitle branch. I prefer the Torrent Providers branch, that one runs fine in a command window, but like the others, that branch will not run as a service. So I keep reverting to my old torrent providers version which does run as a service.

@junalmeida
Copy link
Owner

Hello!

Indeed the need of setup_tools was introduced by my last modifications, that include updating @Diaoul subliminal library. But, I'm not sure where the invalid sintax reported here by @amitkeret have relation to the missing setup_tools.

This problem ocurred because most of python users use setup_tools to get libraries, so a few people were affected by this. I didn't even know that this was a requirement since setup_tools is one of the first things I have installed at all my environments (Windows, OSX, Ubuntu).

@amitkeret Please confirm that installing setup_tools as suggested solves your issue. If not, please confirm your python version. Must be 2.7.x as described by Installation Instructions.

Thank you all, sorry for introducing the setup_tools need. If you are not able to resolve this please contact.

Regards

@Yellow1144
Copy link

Hi Marcos..
First, Thank you for your fine work in maintaining Sickbeard. I love it.

Now I'm a pretty smart guy and usually know what I am doing, but I am not a Python developer or a Linux guy (yet.. but that will have to change soon). Still on Win 7/64 with Python 2.7.5. I've done a lot of reading in the last few days but can't seem to find an answer to this.

I have installed Setup Tools on my system and verified it is indeed installed. The problem is that I have no idea how to setup or update my current installation of Sickbeard with it. It sure does seem that the problems I am having are due to this issue of not using Easy Install.

I would be really happy if you could please explain how to accomplish both a clean new install of sickbeard, and an update of a current sickbeard installation using Easy Install.

A question: If I have Sickbeard currently installed in a particular folder, will Easy Install find that path and just update what is needed? Or will it try to install a new version in a different path?

Also, does this mean that it is no longer possible to update sickbeard from within the SB GUI itself? That we need to download and somehow use easy Install every time? I am no stranger to the command line so no problem there if that is needed.

Thank you in advance

@junalmeida
Copy link
Owner

Hello @Yellow1144. It is the contrary. Sb will continue to update as it was before. You don't need to interact with easy install every time, you just need to have it installed globally with py2.7

@Yellow1144
Copy link

Hi Marcos, thanks for the quick reply.

Then have I been installing new builds of SB incorrectly? in that I have simply been extracting new Zip files downloaded from here to a new folder named SickBeard, then just running it. Configuring it, and allowing it to build it's database by scanning my library. Even after that, the latest SB Torrent Providers will still not run as a service, but will in a command window. Or, should I just from my current, working installation, apply updates from Sickeard? (something I have not yet tried since installing Setup Tools.)

@Yellow1144
Copy link

Well, I tried updating SB. Torrent Providers from within the GUI. It updated and restarted fine. I stopped it and then tried to restart the service.. it still won't start that way, but it does run in a command window.... Soooo (starts to pull out hair)

@wolfster
Copy link

So for everyone who has trouble like me, this got SB working for me again.

I ran all these commands inside the SB installation folder:

For reference, I got the commands form here: http://stackoverflow.com/questions/6012246/why-is-python-easy-install-not-working-on-my-mac

Check your /usr/bin and /usr/local/bin for easy_install installations and remove any old script:

sudo rm /usr/bin/easy_install*

sudo rm /usr/local/bin/easy_install*

Download and run distribute:

curl -O http://python-distribute.org/distribute_setup.py

sudo python distribute_setup.py

sudo rm distribute_setup.py

Try again, and enjoy. E.g.:

sudo easy_install pip

After that, SB started just fine.

I am not sure what I exactly did there, but now I am Up and running again 😃

@hostep
Copy link

hostep commented Mar 15, 2014

I had the same problem, the syntax error was because I had Python 2.6 installed and that line of code uses a syntax that isn't supported in Python 2.6. I fixed it by upgrading to Python 2.7 and now it works without this crash.

@junalmeida
Copy link
Owner

@Yellow1144 Yep, you don't need to update manually. just use the internal update system gui.
About the service, its a bit difficult to debug a service. You are using Windows, right? So I gues you configured svrany.exe to run it as a service. Maybe we have some misconfiguration, for example the "currentdir" while running as a service. Let's talk about this at another place because this is not related to the issue opened.

@hostep @amitkeret Since the problem of invalid syntax is related to the py version, i'm closing this issue.

If you have any other problem please open another issue; 👍

@amitkeret
Copy link
Author

@junalmeida,

I realize this is not essentially a SB problem but rather a python version problem...
However, I can't simply upgrade python. The consequences could mean breaking other packages and the OS to stop functioning.

Personally I'm using OMV, but this applies to others as well.
See here for problematic python upgrade on OMV: http://forums.openmediavault.org/viewtopic.php?f=14&t=3778

Can you suggest another solution to the problem?

@junalmeida
Copy link
Owner

Thats why I installed omv packages over default ubuntu distribution instead of omv iso. I don't know what version of omv do you have, maybe current Sardaukar or the brand new Kralizec have up-to-date python?
Anyway, debian distributions have the option of bin "alternatives", so you can install both py 2.6 and 2.7 together, set 2.6 as default and force SB init script to use 2.7.

@amitkeret
Copy link
Author

Thanks for the suggestion @junalmeida, nice idea (although not very flexible...)
Can you maybe explain how to accomplish this?

I've installed python2.7 with "make altinstall" and it's located in /usr/local/bin. Now in my /etc/init.d/sickbeard script I've changed the DAEMON var to point to the correct python.
I now get an error: "The Python module Cheetah is required". Seems the new python2.7 doesn't load the library.
I tried to symlink: /usr/lib/pyshared/python2.7/Cheetah -> ../python2.6/Cheetah/
...but that didn't work either. ideas?

@junalmeida
Copy link
Owner

you have to follow the installation instructions calling py2.7. Don't symlink anything from 2.6.

Install setup_tools for 2.7 and call easy_install cheetah as root.

@amitkeret
Copy link
Author

Hi @junalmeida,

After much work and headache, I've finally managed to get SB to work under OMV.
I'm posting this now as reference to help other ppl who've encountered the same problem (and for myself when I encounter this sort of thing again :).

My OS is openmediavault 0.4, installed by default is python2.6 & python2.5, with the help of the OMV_Installers script I've installed SB torrents branch.

Install dependencies

# apt-get install sqlite3
# apt-get install python-pysqlite2
# apt-get install python-pysqlite2-dbg
# apt-get install python-pysqlite3-dev
# apt-get install libsqlite3-dev
# apt-get install sqlite

Install python sqlite package

pip install pysqlite

Download and compile python2.7
(as far as I understand it, at this point the sqlite module is installed so the ./configure command will take that into account when compiling python)

# tar xzf Python-2.7.6.tgz
# cd Python-2.7.6
# ./configure
# make
# make altinstall

Notice the altinstall command, as to not change OMV's default python2.6.

Setup easy_install script
Download setuptools-0.6c11-py2.7.egg from setuptools and execute as root

# sh setuptools-0.6c11-py2.7.egg

Use easy_install to install cheetah for python2.7
You need to re-install this module for the new version specifically

# easy_install-2.7 cheetah

Verify python2.7 path

# ls /usr/local/bin/python2.7
/usr/local/bin/python2.7

Modify SB startup script
This is really not flexible cos we're hard-coding the python version... but that's my best solution ATM.

# nano /etc/init.d/sickbeard

....
change:
DAEMON=/usr/bin/python
into:
DAEMON=/usr/local/bin/python2.7
....

You should now be able to fire up SB!

# service sickbeard start

Good luck :)

@junalmeida
Copy link
Owner

Thank you @amitkeret , nice to have it working.

@FernandoMiguel
Copy link

not having much luck with cheetah on a Synology and python 2.7 from optware :(
easy_install-2.7 cheetah
error: /opt/local/lib/python2.5/site-packages (in --site-dirs) is not on sys.path

@junalmeida
Copy link
Owner

Your setup is using python 2.5 libs. Not good.

@FernandoMiguel
Copy link

I have 2.5, 2.6 and 2.7

which python
/usr/bin/python
/volume1/sickbeard/junalmeida > /usr/bin/python --version
Python 2.7.3
/volume1/sickbeard/junalmeida > ls -lah /usr/bin/python
lrwxrwxrwx 1 root root 24 2014-03-25 20:55 /usr/bin/python -> /usr/local/bin/python2.7

@junalmeida
Copy link
Owner

But look at the error message: You call easy_install-2.7 and site-packages path is 2.5: /opt/local/lib/python2.5/site-packages

If your default python is 2.7 I guess that you can follow the standard install instruction on this wiki.

@FernandoMiguel
Copy link

There's no py-cheeta in optware. So I was trying the alternative method

@junalmeida
Copy link
Owner

I'm not sure if I got you. Did you tried this:

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo python ez_setup.py
sudo easy_install cheetah

@FernandoMiguel
Copy link

Yep. In a few minutes I'll SSH into my screen and paste the results

@junalmeida
Copy link
Owner

I don't know a bit about your NAS. But if you don't have wget installed, try curl. If not sudo, try su.

@FernandoMiguel
Copy link

python2.7 ez_setup.py
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-3.4.1.zip
Extracting in /tmp/tmpATbIPD
Now working in /tmp/tmpATbIPD/setuptools-3.4.1
Installing Setuptools
running install
error: /opt/local/lib/python2.5/site-packages (in --site-dirs) is not on sys.path
Something went wrong during the installation.
See the error message above.

@junalmeida
Copy link
Owner

I cannot figure out why calling python2.7 uses packages from 2.5. If you don't find an answer I guess that you will need to start over purging all pythons.

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

No branches or pull requests

8 participants