Describe the bug
I upgraded to 0.2.9 from 0.2.8 and Medusa would no longer start. The problem seems to be
related to adba. It tries to load an external module configparser import ConfigParser but it fails
to find the module and exits.
To Reproduce
Start medusa after upgrading to 0.2.9
Expected behavior
Medusa should start as usual instead of failing and exiting.
Medusa (please complete the following information):
Logs:
Sep 07 08:07:56 norm env[30534]: File "/opt/Medusa/medusa/scene_exceptions.py", line 13, in <module>
Sep 07 08:07:56 norm env[30534]: import adba
Sep 07 08:07:56 norm env[30534]: File "/opt/Medusa/ext/adba/__init__.py", line 27, in <module>
Sep 07 08:07:56 norm env[30534]: from configparser import ConfigParser
Sep 07 08:07:56 norm env[30534]: File "/opt/Medusa/ext/configparser.py", line 12, in <module>
Sep 07 08:07:56 norm env[30534]: from backports.configparser import (
Sep 07 08:07:56 norm env[30534]: ImportError: No module named configparser
Sep 07 08:07:56 norm systemd[882]: medusa.service: Control process exited, code=exited status=1
Sep 07 08:07:56 norm systemd[882]: medusa.service: Failed with result 'exit-code'.
Sep 07 08:07:56 norm systemd[882]: Failed to start Medusa user service.
Sep 07 08:07:56 norm env[30534]: Traceback (most recent call last):
Sep 07 08:07:56 norm env[30534]: File "/opt/Medusa/start.py", line 6, in <module>
Sep 07 08:07:56 norm env[30534]: from medusa.__main__ import main
Sep 07 08:07:56 norm env[30534]: File "/opt/Medusa/medusa/__main__.py", line 67, in <module>
Sep 07 08:07:56 norm env[30534]: from medusa import (
Sep 07 08:07:56 norm env[30534]: File "/opt/Medusa/medusa/name_cache.py", line 12, in <module>
Sep 07 08:07:56 norm env[30534]: from medusa.scene_exceptions import (
Sep 07 08:07:56 norm env[30534]: File "/opt/Medusa/medusa/scene_exceptions.py", line 13, in <module>
Sep 07 08:07:56 norm env[30534]: import adba
Sep 07 08:07:56 norm env[30534]: File "/opt/Medusa/ext/adba/__init__.py", line 27, in <module>
Sep 07 08:07:56 norm env[30534]: from configparser import ConfigParser
Sep 07 08:07:56 norm env[30534]: File "/opt/Medusa/ext/configparser.py", line 12, in <module>
Sep 07 08:07:56 norm env[30534]: from backports.configparser import (
Sep 07 08:07:56 norm env[30534]: ImportError: No module named configparser
Sep 07 08:07:56 norm systemd[882]: medusa.service: Control process exited, code=exited status=1
Sep 07 08:07:56 norm systemd[882]: medusa.service: Failed with result 'exit-code'.
Additional context
I'm guessing the problem is related to this adba commit:
@sharkykh eeh i included backports?
How do you start medusa?
Whats you python version?
@p0psicles Possibly related... Old pyc files?
https://github.com/pymedusa/Medusa/issues/3184
I start medusa as a systemd user service. Python version is 2.7.15
Not old pyc files (I moved my old install directory and cloned a brand new directory to test before I posted the issue...that had the same problem, so then I checked out the previous release and everything works again)
Here is the unit file that I use to launch Medusa as a systemd user service. You can see the options that I pass to Medusa in the ExecStart line, in case that is relevant to the issue.
[Unit]
Description=Medusa user service
Wants=network-online.target
After=network-online.target
[Service]
Type=forking
GuessMainPID=no
ExecStart=/usr/bin/env python2 /opt/Medusa/start.py --quiet --nolaunch --daemon --datadir %h/.medusa
[Install]
WantedBy=default.target
I was just able to reproduce... kind of.
I removed ext/backports/__init__.py, and then cd'd to ext/ and tried to import:
@ /dev/medusa
$ rm ext/backports/__init__.py
$ cd ext/
$ python -c "import configparser"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "configparser.py", line 12, in <module>
from backports.configparser import (
ImportError: No module named configparser
@jtwill
ext/backports/__init__.pyfrom pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
/usr/bin/python2 /opt/Medusa/start.py [args] (remove /env)... It's a long shot thoughI git cloned a new copy from Master and then checked the file:
$ cat /opt/Medusa/ext/backports/__init__.py
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
Looks okay to me. I changed my systemd unit file as shown:
[Unit]
Description=Medusa user service
Wants=network-online.target
After=network-online.target
[Service]
Type=forking
GuessMainPID=no
#ExecStart=/usr/bin/env python2 /opt/Medusa/start.py --quiet --nolaunch --daemon --datadir %h/.medusa
ExecStart=/usr/bin/python2.7 /opt/Medusa/start.py --quiet --nolaunch --daemon --datadir %h/.medusa
[Install]
WantedBy=default.target
Same problem, here is the systemd log on attempted start:
-- Unit UNIT has begun starting up.
Sep 07 18:01:04 norm python2.7[6088]: Traceback (most recent call last):
Sep 07 18:01:04 norm python2.7[6088]: File "/opt/Medusa/start.py", line 6, in <module>
Sep 07 18:01:04 norm python2.7[6088]: from medusa.__main__ import main
Sep 07 18:01:04 norm python2.7[6088]: File "/opt/Medusa/medusa/__main__.py", line 67, in <module>
Sep 07 18:01:04 norm python2.7[6088]: from medusa import (
Sep 07 18:01:04 norm python2.7[6088]: File "/opt/Medusa/medusa/name_cache.py", line 12, in <module>
Sep 07 18:01:04 norm python2.7[6088]: from medusa.scene_exceptions import (
Sep 07 18:01:04 norm python2.7[6088]: File "/opt/Medusa/medusa/scene_exceptions.py", line 13, in <module>
Sep 07 18:01:04 norm python2.7[6088]: import adba
Sep 07 18:01:04 norm python2.7[6088]: File "/opt/Medusa/ext/adba/__init__.py", line 27, in <module>
Sep 07 18:01:04 norm python2.7[6088]: from configparser import ConfigParser
Sep 07 18:01:04 norm python2.7[6088]: File "/opt/Medusa/ext/configparser.py", line 12, in <module>
Sep 07 18:01:04 norm python2.7[6088]: from backports.configparser import (
Sep 07 18:01:04 norm python2.7[6088]: ImportError: No module named configparser
Sep 07 18:01:04 norm systemd[882]: medusa.service: Control process exited, code=exited status=1
Sep 07 18:01:04 norm systemd[882]: medusa.service: Failed with result 'exit-code'.
Sep 07 18:01:04 norm systemd[882]: Failed to start Medusa user service.
-- Subject: Unit UNIT has failed
I also tried launching it from the command line, to eliminate any unknown systemd interactions. Same error:
$ /usr/bin/python2 "/opt/Medusa/start.py" --quiet --nolaunch --datadir "/home/user/.medusa"
Traceback (most recent call last):
File "/opt/Medusa/start.py", line 6, in <module>
from medusa.__main__ import main
File "/opt/Medusa/medusa/__main__.py", line 67, in <module>
from medusa import (
File "/opt/Medusa/medusa/name_cache.py", line 12, in <module>
from medusa.scene_exceptions import (
File "/opt/Medusa/medusa/scene_exceptions.py", line 13, in <module>
import adba
File "/opt/Medusa/ext/adba/__init__.py", line 27, in <module>
from configparser import ConfigParser
File "/opt/Medusa/ext/configparser.py", line 12, in <module>
from backports.configparser import (
ImportError: No module named configparser
@jtwill
I believe I found the issue.
Can you please try the bugfix/configparser-better-syspath branch?
(It's based on v0.2.9 or current master)
Well done! commit 90688998f70ee3bf7be1cb0f0e9273d7ac2b5926 fixed the issue and Medusa is running fine for me now at release v0.2.9 + that commit.
Thank you for helping to debug this! Hopefully we'll be able to fix master soon.
Hmm, just upgraded Medusa and ran into this problem, any idea when it will be in the master branch?
Well hotfix it. In the mean time, please try to use the branch @sharkykh provided.
I think we should be able to release a hotfix by tomorrow.
@jtwill
@Rouzax
And anyone else who switched to the bugfix/configparser-better-syspath branch:
You can now switch back to master
The fix was released and I've removed the branch.
@p0psicles @sharkykh Still can't start Medusa after a pull
C:\GitHub\Medusa>"C:\GitHub\Medusa\SickBeard.py"
ERROR:stevedore.extension:Could not load 'subscenter': No module named subscenter
Traceback (most recent call last):
File "C:\GitHub\Medusa\SickBeard.py", line 6, in <module>
from medusa.__main__ import main
File "C:\GitHub\Medusa\medusa\__main__.py", line 67, in <module>
from medusa import (
File "C:\GitHub\Medusa\medusa\name_cache.py", line 12, in <module>
from medusa.scene_exceptions import (
File "C:\GitHub\Medusa\medusa\scene_exceptions.py", line 13, in <module>
import adba
ImportError: No module named adba
Seriously Python? What now?
I swear I tested to make sure the paths are inserted correctly, if it didn't, it wouldn't have worked for anyone.
@Rouzax
Maybe it's compiled python code that's throwing it off.
Can you please try running (in C:\GitHub\Medusa):
git clean -f -d lib ext medusa?
On a side note, I never really run Python scripts like that, can you try running it like this?
python "C:\GitHub\Medusa\SickBeard.py"
The compiled python could be the case, will give it a try when I have the chance.
Also tested with python.exe but with the same result.
@sharkykh, that did not help
C:\GitHub\Medusa>git clean -f -d lib ext medusa
C:\GitHub\Medusa>python.exe "C:\GitHub\Medusa\SickBeard.py"
ERROR:stevedore.extension:Could not load 'subscenter': No module named subscenter
Traceback (most recent call last):
File "C:\GitHub\Medusa\SickBeard.py", line 6, in <module>
from medusa.__main__ import main
File "C:\GitHub\Medusa\medusa\__main__.py", line 67, in <module>
from medusa import (
File "C:\GitHub\Medusa\medusa\name_cache.py", line 12, in <module>
from medusa.scene_exceptions import (
File "C:\GitHub\Medusa\medusa\scene_exceptions.py", line 13, in <module>
import adba
ImportError: No module named adba
It looks like my git pull was not working because it saw local files (that I didn't create and I've always been on Master)
C:\GitHub\Medusa>git branch
develop
* master
C:\GitHub\Medusa>git pull
error: Your local changes to the following files would be overwritten by merge:
.build/Gruntfile.js
.build/bower.json
.gitattributes
.github/build-themes-check.sh
.github/check_version.py
.travis.yml
CHANGELOG.md
dredd/api-description.yml
ext/bs4/__init__.py
ext/bs4/builder/__init__.py
ext/bs4/builder/_htmlparser.py
ext/bs4/builder/_lxml.py
ext/bs4/dammit.py
ext/bs4/diagnose.py
ext/bs4/element.py
ext/bs4/testing.py
ext/bs4/tests/test_htmlparser.py
ext/bs4/tests/test_lxml.py
ext/bs4/tests/test_tree.py
ext/certifi/__init__.py
ext/certifi/cacert.pem
ext/dogpile/__init__.py
ext/dogpile/cache/region.py
ext/readme.md
lib/readme.md
lib/simpleanidb/__init__.py
medusa/classes.py
medusa/clients/torrent/deluge_client.py
medusa/clients/torrent/utorrent_client.py
medusa/common.py
medusa/config.py
medusa/databases/__init__.py
medusa/databases/cache_db.py
medusa/databases/failed_db.py
medusa/databases/main_db.py
medusa/db.py
medusa/event_queue.py
medusa/generic_queue.py
medusa/helpers/__init__.py
medusa/helpers/anidb.py
medusa/helpers/externals.py
medusa/history.py
medusa/indexers/indexer_base.py
medusa/indexers/indexer_config.py
medusa/indexers/indexer_ui.py
medusa/indexers/tmdb/tmdb.py
medusa/indexers/tmdb/tmdb_exceptions.py
medusa/indexers/tvdbv2/fallback.py
medusa/indexers/tvdbv2/tvdbv2_exceptions.py
medusa/indexers/tvmaze/tvmaze_exceptions.py
medusa/init/__init__.py
medusa/init/logconfig.py
medusa/logger/__init__.py
medusa/metadata/generic.py
medusa/metadata/kodi.py
medusa/metadata/mede8er.py
medusa/metadata/media_browser.py
medusa/metadata/ps3.py
medusa/metadata/tivo.py
medusa/metadata/wdtv.py
medusa/name_cache.py
medusa/name_parser/parser.py
medusa/naming.py
medusa/notifiers/__init__.py
medusa/notifiers/libnotify.py
medusa/notifiers/trakt.py
medusa/nzb_splitter.py
medusa/post_processor.py
medusa/process_tv.py
medusa/providers/generic_provider.py
medusa/providers/nzb/binsearch.py
medusa/providers/torrent/html/abnormal.py
medusa/providers/torrent/html/alpharatio.py
medusa/providers/torrent/html/anidex.py
medusa/providers/torrent/html/animetorrents.py
medusa/providers/torrent/html/archetorrent.py
medusa/providers/torrent/html/bithdtv.py
medusa/providers/torrent/html/bjshare.py
medusa/providers/torrent/html/elitetracker.py
medusa/providers/torrent/html/hdspace.py
medusa/providers/torrent/html/hdtorrents.py
medusa/providers/torrent/html/hebits.py
medusa/providers/torrent/html/iptorrents.py
medusa/providers/torrent/html/limetorrents.py
medusa/providers/torrent/html/morethantv.py
medusa/providers/torrent/html/nebulance.py
medusa/providers/torrent/html/pretome.py
medusa/providers/torrent/html/scenetime.py
medusa/providers/torrent/html/sdbits.py
medusa/providers/torrent/html/speedcd.py
medusa/providers/torrent/html/thepiratebay.py
medusa/providers/torrent/html/tntvillage.py
medusa/providers/torrent/html/tokyotoshokan.py
medusa/providers/torrent/html/torrent9.py
medusa/providers/torrent/html/torrentbytes.py
medusa/providers/torrent/html/torrenting.py
medusa/providers/torrent/html/tvchaosuk.py
medusa/providers/torrent/html/yggtorrent.py
medusa/providers/torrent/html/zooqle.py
medusa/providers/torrent/json/animebytes.py
medusa/providers/torrent/json/bitcannon.py
medusa/providers/torrent/json/btn.py
medusa/providers/torrent/json/danishbits.py
medusa/providers/torrent/json/hdbits.py
medusa/providers/torrent/json/norbits.py
medusa/providers/torrent/json/rarbg.py
medusa/providers/torrent/json/torrentday.py
medusa/providers/torrent/json/torrentleech.py
medusa/providers/torrent/rss/nyaa.py
medusa/providers/torrent/torznab/torznab.py
medusa/providers/torrent/xml/torrentz2.py
medusa/scene_exceptions.py
medusa/scene_numbering.py
medusa/scheduler.py
medusa/search/core.py
medusa/search/manual.py
medusa/search/proper.py
medusa/server/api/v2/base.py
medusa/server/api/v2/config.py
medusa/server/api/v2/episodes.py
medusa/server/core.py
medusa/server/web/config/post_processing.py
medusa/server/web/home/add_recommended.py
medusa/server/web/h
error: The following untracked working tree files would be overwritten by merge:
.yarnrc
setup.cfg
themes-default/slim/.yarnrc
themes-default/slim/src/api.js
themes-default/slim/src/app.js
themes-default/slim/src/components/add-recommended.vue
themes-default/slim/src/components/add-shows.vue
themes-default/slim/src/components/anidb-release-group-ui.vue
themes-default/slim/src/components/app-header.vue
themes-default/slim/src/components/app-link.vue
themes-default/slim/src/components/asset.vue
themes-default/slim/src/components/backstretch.vue
themes-default/slim/src/components/config-post-processing.vue
themes-default/slim/src/components/config-textbox-number.vue
themes-default/slim/src/components/config-textbox.vue
themes-default/slim/src/components/config-toggle-slider.vue
themes-default/slim/src/components/config.vue
themes-default/slim/src/components/display-show.vue
themes-default/slim/src/components/file-browser.vue
themes-default/slim/src/components/home.vue
themes-default/slim/src/components/http/404.vue
themes-default/slim/src/components/http/index.js
themes-default/slim/src/components/index.js
themes-default/slim/src/components/irc.vue
themes-default/slim/src/components/language-select.vue
themes-default/slim/src/components/login.vue
themes-default/slim/src/components/manual-post-process.vue
themes-default/slim/src/components/name-pattern.vue
themes-default/slim/src/components/plot-info.vue
themes-default/slim/src/components/root-dirs.vue
themes-default/slim/src/components/scroll-buttons.vue
themes-default/slim/src/components/select-list.vue
themes-default/slim/src/components/show-selector.vue
themes-default/slim/src/components/snatch-selection.vue
themes-default/slim/src/components/status.vue
themes-default/slim/src/css/open-sans.css
themes-default/slim/src/fonts/open-sans-v15-latin-300.ttf
themes-default/slim/src/fonts/open-sans-v15-latin-300italic.ttf
themes-default/slim/src/fonts/open-sans-v15-latin-600.ttf
themes-default/slim/src/fonts/open-sans-v15-latin-600italic.ttf
themes-default/slim/src/fonts/open-sans-v15-latin-700.ttf
themes-default/slim/src/fonts/open-sans-v15-latin-700italic.ttf
themes-default/slim/src/fonts/open-sans-v15-latin-800.ttf
themes-default/slim/src/fonts/open-sans-v15-latin-800italic.ttf
themes-default/slim/src/fonts/open-sans-v15-latin-italic.ttf
themes-default/slim/src/fonts/open-sans-v15-latin-regular.ttf
themes-default/slim/src/index.js
themes-default/slim/src/router.js
themes-default/slim/src/store/index.js
themes-default/slim/src/store/modules/auth.js
themes-default/slim/src/store/modules/config.js
themes-default/slim/src/store/modules/defaults.js
themes-default/slim/src/store/modules/index.js
themes-default/slim/src/store/modules/metadata.js
themes-default/slim/src/store/modules/notifications.js
themes-default/slim/src/store/modules/qualities.js
themes-default/slim/src/store/modules/shows.js
themes-default/slim/src/store/modules/socket.js
themes-default/slim/src/store/modules/statuses.js
themes-default/slim/src/store/mutation-types.js
themes-default/slim/src/utils.js
themes-default/slim/static/images/network/tv4-(se).png
themes-default/slim/test/__fixtures__/root-dirs.json
themes-default/slim/test/__fixtures__/shows.json
themes-default/slim/test/specs/asset.spec.js
themes-default/slim/test/specs/config-post-processing.spec.js
themes-default/slim/test/specs/config-textbox-number.spec.js
themes-default/slim/test/specs/config-textbox.spec.js
themes-default/slim/test/specs/config-toggle-slider.spec.js
themes-default/slim/test/specs/config.spec.js
themes-default/slim/test/specs/irc.spec.js
themes-default/slim/test/specs/name-pattern.spec.js
themes-default/slim/test/specs/root-dirs.spec.js
themes-default/slim/test/specs/router.spec.js
themes-default/slim/test/specs/select-list.spec.js
themes-default/slim/test/specs/show-selector.spec.js
themes-default/slim/test/specs/snapshots/asset.spec.js.md
themes-default/slim/test/specs/snapshots/asset.spec.js.snap
themes-default/slim/test/specs/snapshots/config-post-processi
Aborting
Updating f5973b284..4614efc77
C:\GitHub\
After doing the following it works.
C:\GitHub\Medusa>git fetch --all
Fetching origin
C:\GitHub\Medusa>git reset --hard origin/master
HEAD is now at 4614efc77 Merge pull request #5163 from pymedusa/release/hotfix-0.2.10
C:\GitHub\Medusa>git pull
Already up-to-date.
During start it still gives
ERROR:stevedore.extension:Could not load 'subscenter': No module named subscenter
But it now works.
Good to know, thanks :)
About the error, do you happen to have subliminal installed globally?
If you do, it's probably trying to load the extension on that code.
https://github.com/Diaoul/subliminal/blob/2.0.5/setup.py#L76
That provider was removed from subliminal since 2.0.5, but no new version has been released yet.
Medusa uses the most up-to-date develop version of subliminal.
Edit: Actually I was just able to confirm that's exactly the case.
@sharkykh you're absolutely right, I had Subliminal installed and forgot about it.
Thank you for all your help.
Still weird that my git pull wouldn't work.
BTW: Is there a list pf current python modules Medusa is depended on?
You're welcome.
Still weird that my git pull wouldn't work.
It's possible a git checkout went wrong somewhere/sometime. It can happen sometimes...
In any case git reset --hard origin/master (which is what you did) is the correct solution to the problem.
BTW: Is there a list pf current python modules Medusa is depended on?
Medusa still vendors all of its dependencies.
However, there are two lists containing all the current dependencies Medusa depends on.
They're not a 100% human-readable though :P
Note: The lists are from the develop branch.
thanks, I'm thinking about clearing out my Python installation as it has been around and upgraded since Sickbeard.
Most helpful comment
Well hotfix it. In the mean time, please try to use the branch @sharkykh provided.
I think we should be able to release a hotfix by tomorrow.