Branch/Commit: master/460ab74
OS: Debian 8.11
Browser: N/A
What you did: Updated
What happened: Failed to restart
What you expected: Restart and work
Logs:
Traceback (most recent call last):
File "/apps/sickchill/SickBeard.py", line 67, in <module>
import sickbeard
File "/apps/sickchill/sickbeard/__init__.py", line 41, in <module>
import sickchill
File "/apps/sickchill/sickchill/__init__.py", line 5, in <module>
from .show.indexers import indexer, ShowIndexer
File "/apps/sickchill/sickchill/show/indexers/__init__.py", line 22, in <module>
from .handler import ShowIndexer
File "/apps/sickchill/sickchill/show/indexers/handler.py", line 31, in <module>
from sickbeard.tv import Show
File "/apps/sickchill/sickbeard/tv.py", line 48, in <module>
from . import db, helpers, logger, network_timezones, notifiers, postProcessor, subtitles
File "/apps/sickchill/sickbeard/helpers.py", line 55, in <module>
import cloudscraper
File "/apps/sickchill/lib/cloudscraper/__init__.py", line 27, in <module>
from .exceptions import (
ImportError: cannot import name CloudflareLoopProtection
Temporary workaround until a fix is made:
--- lib/cloudscraper/__init__-orig.py 2020-04-18 22:10:01.829854203 +1000
+++ lib/cloudscraper/__init__.py 2020-04-18 22:10:10.048853841 +1000
@@ -24,14 +24,6 @@
from requests.sessions import Session
from requests.adapters import HTTPAdapter
-from .exceptions import (
- CloudflareLoopProtection,
- CloudflareCode1020,
- CloudflareIUAMError,
- CloudflareReCaptchaError,
- CloudflareReCaptchaProvider
-)
-
from .interpreters import JavaScriptInterpreter
from .reCaptcha import reCaptcha
from .user_agent import User_Agent
What is the output of python2 -c 'from lib.cloudscraper.exceptions import CloudflareLoopProtection' ?
root@sickchill:/usr/local/sickchill/lib/cloudscraper/interpreters # /usr/local/bin/python2.7 -c 'from lib.cloudscraper.exceptions import CloudflareLoopProtection'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named lib.cloudscraper.exceptions
You arent in the right directory.
cd /usr/local/sickchill/lib/cloudscraper
python2 -c 'from .exceptions import CloudflareLoopProtection'
I don't think the current working directory matters - but I switched to /usr/local/sickchill/lib/cloudscraper and got the same result:
root@sickchill:/usr/local/sickchill/lib/cloudscraper # /usr/local/bin/python2.7 -c 'from lib.cloudscraper.exceptions import CloudflareLoopProtection'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named lib.cloudscraper.exceptions
root@sickchill:/usr/local/sickchill/lib/cloudscraper # python2.7 -c 'from .exceptions import CloudflareLoopProtection'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ValueError: Attempted relative import in non-package
I have the same exact issue
Just wanted to confirm I have the same issue and this workaround solves it for me and allows starting SC again. For the most recent release there's also a similar import in lib/cloudscraper/interpreters/__init__.py
root@sickchill:/usr/local/sickchill/lib/cloudscraper # /usr/local/bin/python2.7 -c 'from lib.cloudscraper.exceptions import CloudflareLoopProtection'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named lib.cloudscraper.exceptions
I am a bit nervous monkey patching this in, if i do this temp fix will the next update still work properly. or will i need to remember to revert?
@miigotu
➜ cloudscraper pwd
/apps/sickchill/lib/cloudscraper
➜ cloudscraper python2 -c 'from .exceptions import CloudflareLoopProtection'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ValueError: Attempted relative import in non-package
btw once this is patched, is there a cli way i can update sickchill without running the app?
cd path/to/sickchill && git pull
lol
cd /apps/sickchill/lib
python2 -c 'from cloudscraper.exceptions import CloudflareLoopProtection'
Neals-Mac-Pro:lib phire$ pwd
/Applications/sickrage/lib
Neals-Mac-Pro:lib phire$ python2 -c 'from cloudscraper.exceptions import CloudflareLoopProtection'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "cloudscraper/__init__.py", line 27, in <module>
from .exceptions import (
ImportError: cannot import name CloudflareLoopProtection
➜ sickchill cd lib
➜ lib pwd
/apps/sickchill/lib
➜ lib python2 -c 'from cloudscraper.exceptions import CloudflareLoopProtection'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "cloudscraper/__init__.py", line 27, in <module>
from .exceptions import (
ImportError: cannot import name CloudflareLoopProtection
➜ lib
side note:
my sickchill folder doesn't have a .git folder. prob because I used someone elses install file sickchill_2018.11.07-ml0_all.deb so i could get it working on my ReadyNAS, however updating inside the app seems to work, so not a big issue.
The temp fix doesn't prevent in-app updates and updating within the app will revert the temp fix.
The temp fix doesn't prevent in-app updates and updating within the app will revert the temp fix.
That's the point of it being a _temporary_ workaround, with the added benefit of enanbling users who don't have a .git folder (such as ReadyNAS users) to easily update when a fix is released.
check the lib/cloudscraper directory and that you dont have an old exceptions directory which was in earlier versions, which was replaced by exceptions.py
root@tvz0r:/tmp# git clone https://github.com/SickChill/SickChill.git
Cloning into 'SickChill'...
remote: Enumerating objects: 2251, done.
remote: Counting objects: 100% (2251/2251), done.
remote: Compressing objects: 100% (1700/1700), done.
remote: Total 104859 (delta 654), reused 1640 (delta 406), pack-reused 102608
Receiving objects: 100% (104859/104859), 229.91 MiB | 16.30 MiB/s, done.
Resolving deltas: 100% (63791/63791), done.
root@tvz0r:/tmp# cd SickChill/
root@tvz0r:/tmp/SickChill# python2 -c 'from lib.cloudscraper.exceptions import CloudflareLoopProtection'
root@tvz0r:/tmp/SickChill# python3 -c 'from lib.cloudscraper.exceptions import CloudflareLoopProtection'
root@tvz0r:/tmp/SickChill#
removing lib/cloudscraper/exceptions/ resolved the issue for me. thank you
This is because of the way git acts, it does not delete directories on a pull, in reality a git clean -D should be run to remove directories and untracked changes... BUT this will purge things like config files / or your sickchill database and logs,i would NOT recommend it
@VeNoMouS ahh ic, what should i do as my install via readynas does not have a git repo
should i rm -rf lib/cloudscraper/exceptions/
( https://github.com/SickChill/readynas-sickchill )
@VeNoMouS sometimes git is a pain, sometimes with case sensitive as well, but there is a git mv and git rm command i think?
should i rm -rf lib/cloudscraper/exceptions/
yes
Thank you!! @VeNoMouS @sawwashere and others thank you so much for helping!!!
np ❤️ , yea when i wrote exceptions i initially had a different version, but i ended up going another direction.... sorry about that
check the
lib/cloudscraperdirectory and that you dont have an old exceptions directory which was in earlier versions, which was replaced byexceptions.py
Thanks for confirming this was old code that needed to be manually deleted.
In future, there should be a cleanup script added to accomodate changes (e.g. deletions) such as this, especially for users that do not run SickChill directly out of git (such as ReadyNAS users), so many users don't end up with a broken installation and may not have the skills to fix it themselves.
There probably also needs an FAQ entry added describing this issue and the fix for other users searching for a solution.
This is because of the way git acts, it does not delete directories on a pull, in reality a
git clean -Dshould be run to remove directories and untracked changes... BUT this will purge things like config files / or your sickchill database and logs,i would NOT recommend it
Configuration, database and logs should _NOT_ be part of the git repository, but instantiated from templates or scripts on first run — to avoid this specific situation.
Clearing the /exceptions/ folder fixed this for me, too. Thank you.
Ugh, glad it makes sense now. Haven't had that issue in a really long time but I definitely changed a lot of code haha
600k changed lines in the last week:
https://github.com/SickChill/SickChill/compare/3a045ba...bf9dd8a?expand=1
btw, git clean -df should not remove anything SC creates as long as you did not set custom dirs inside of SC source.
You can safely run git clean -dnf to see what it would remove.
uh.... what about the database... that is an untracked change.. simply by adding a show, it is changed from the base.
@VeNoMouS it is in the gitignore ^
Most helpful comment
np ❤️ , yea when i wrote exceptions i initially had a different version, but i ended up going another direction.... sorry about that