LSIO bazarr container fails to start after update, Python error related to missing 'pkg_resources' module

Hello, I just updated my Bazarr container and it now exits immediately after starting as it gets a Python error:

Specifically, it errors with ModuleNotFoundError: No module named 'pkg_resources'.

I’m not sure if this could have something to do with Python version issues or something? I’d assume the Python version is included in the container though.

I’m running this on a Synology NAS using their container manager system, everything up to date.

I’m on the latest version of the image.

Full log below (two iterations of it starting and existing, does the same thing every time):

2023/10/20 20:23:34 stdout ModuleNotFoundError: No module named ‘pkg_resources’
2023/10/20 20:23:34 stdout from pkg_resources import iter_entry_points, EntryPoint
2023/10/20 20:23:34 stdout File /app/bazarr/bin/bazarr/…/libs/babelfish/converters/init.py, line 5, in
2023/10/20 20:23:34 stdout from .converters import (LanguageConverter, LanguageReverseConverter, LanguageEquivalenceConverter, CountryConverter,
2023/10/20 20:23:34 stdout File /app/bazarr/bin/bazarr/…/libs/babelfish/init.py, line 14, in
2023/10/20 20:23:34 stdout from babelfish import Language, LanguageReverseError
2023/10/20 20:23:34 stdout File /app/bazarr/bin/bazarr/…/libs/subliminal/core.py, line 29, in
2023/10/20 20:23:34 stdout from .core import (AsyncProviderPool, ProviderPool, check_video, download_best_subtitles, download_subtitles,
2023/10/20 20:23:34 stdout File /app/bazarr/bin/bazarr/…/libs/subliminal/init.py, line 12, in
2023/10/20 20:23:34 stdout from subliminal.cache import region
2023/10/20 20:23:34 stdout File /app/bazarr/bin/bazarr/app/config.py, line 8, in
2023/10/20 20:23:34 stdout from .config import settings
2023/10/20 20:23:34 stdout File /app/bazarr/bin/bazarr/app/check_update.py, line 15, in
2023/10/20 20:23:34 stdout ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023/10/20 20:23:34 stdout from app.check_update import apply_update, check_releases, check_if_new_update # noqa E402
2023/10/20 20:23:34 stdout File /app/bazarr/bin/bazarr/main.py, line 22, in
2023/10/20 20:23:34 stdout Traceback (most recent call last):
2023/10/20 20:23:33 stdout Bazarr starting…
2023/10/20 20:23:32 stdout Bazarr exited.
2023/10/20 20:23:31 stdout ModuleNotFoundError: No module named ‘pkg_resources’
2023/10/20 20:23:31 stdout from pkg_resources import iter_entry_points, EntryPoint
2023/10/20 20:23:31 stdout File /app/bazarr/bin/bazarr/…/libs/babelfish/converters/init.py, line 5, in
2023/10/20 20:23:31 stdout from .converters import (LanguageConverter, LanguageReverseConverter, LanguageEquivalenceConverter, CountryConverter,
2023/10/20 20:23:31 stdout File /app/bazarr/bin/bazarr/…/libs/babelfish/init.py, line 14, in
2023/10/20 20:23:31 stdout from babelfish import Language, LanguageReverseError
2023/10/20 20:23:31 stdout File /app/bazarr/bin/bazarr/…/libs/subliminal/core.py, line 29, in
2023/10/20 20:23:31 stdout from .core import (AsyncProviderPool, ProviderPool, check_video, download_best_subtitles, download_subtitles,
2023/10/20 20:23:31 stdout File /app/bazarr/bin/bazarr/…/libs/subliminal/init.py, line 12, in
2023/10/20 20:23:31 stdout from subliminal.cache import region
2023/10/20 20:23:31 stdout File /app/bazarr/bin/bazarr/app/config.py, line 8, in
2023/10/20 20:23:31 stdout from .config import settings
2023/10/20 20:23:31 stdout File /app/bazarr/bin/bazarr/app/check_update.py, line 15, in
2023/10/20 20:23:31 stdout ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023/10/20 20:23:31 stdout from app.check_update import apply_update, check_releases, check_if_new_update # noqa E402
2023/10/20 20:23:31 stdout File /app/bazarr/bin/bazarr/main.py, line 22, in
2023/10/20 20:23:31 stdout Traceback (most recent call last):
2023/10/20 20:23:30 stdout Bazarr starting…

Also worth pointing out that this was after re-creating the container. I had updated sonarr, radarr, overseerr, and bazarr and none of them work, until I found online that recreating the containers (by duplicating their settings) fixed the issue. Doing this made my sonarr/radar/overseerr work fine, but the new bazarr container has this Python error. I assume it’s not related to my config given that it’s a missing python module?

The logs at the very start were like this:

2023/10/20 20:17:02 stdout Bazarr exited.
2023/10/20 20:17:01 stdout ModuleNotFoundError: No module named ‘pkg_resources’
2023/10/20 20:17:01 stdout from pkg_resources import iter_entry_points, EntryPoint
2023/10/20 20:17:01 stdout File /app/bazarr/bin/bazarr/…/libs/babelfish/converters/init.py, line 5, in
2023/10/20 20:17:01 stdout from .converters import (LanguageConverter, LanguageReverseConverter, LanguageEquivalenceConverter, CountryConverter,
2023/10/20 20:17:01 stdout File /app/bazarr/bin/bazarr/…/libs/babelfish/init.py, line 14, in
2023/10/20 20:17:01 stdout from babelfish import Language, LanguageReverseError
2023/10/20 20:17:01 stdout File /app/bazarr/bin/bazarr/…/libs/subliminal/core.py, line 29, in
2023/10/20 20:17:01 stdout from .core import (AsyncProviderPool, ProviderPool, check_video, download_best_subtitles, download_subtitles,
2023/10/20 20:17:01 stdout File /app/bazarr/bin/bazarr/…/libs/subliminal/init.py, line 12, in
2023/10/20 20:17:01 stdout from subliminal.cache import region
2023/10/20 20:17:01 stdout File /app/bazarr/bin/bazarr/app/config.py, line 8, in
2023/10/20 20:17:01 stdout from .config import settings
2023/10/20 20:17:01 stdout File /app/bazarr/bin/bazarr/app/check_update.py, line 15, in
2023/10/20 20:17:01 stdout ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023/10/20 20:17:01 stdout from app.check_update import apply_update, check_releases, check_if_new_update # noqa E402
2023/10/20 20:17:01 stdout File /app/bazarr/bin/bazarr/main.py, line 22, in
2023/10/20 20:17:01 stdout Traceback (most recent call last):
2023/10/20 20:16:59 stdout Bazarr starting…
2023/10/20 20:16:58 stdout [custom-init] No custom files found, skipping…
2023/10/20 20:16:58 stdout
2023/10/20 20:16:58 stdout ───────────────────────────────────────
2023/10/20 20:16:58 stdout User GID: 100
2023/10/20 20:16:58 stdout User UID: 1031
2023/10/20 20:16:58 stdout
2023/10/20 20:16:58 stdout ───────────────────────────────────────
2023/10/20 20:16:58 stdout GID/UID
2023/10/20 20:16:58 stdout ───────────────────────────────────────
2023/10/20 20:16:58 stdout
2023/10/20 20:16:58 stdout
2023/10/20 20:16:58 stdout To support LSIO projects visit:
2023/10/20 20:16:58 stdout
2023/10/20 20:16:58 stdout Bazarr:
2023/10/20 20:16:58 stdout To support the app dev(s) visit:
2023/10/20 20:16:58 stdout
2023/10/20 20:16:58 stdout ───────────────────────────────────────
2023/10/20 20:16:58 stdout Brought to you by
2023/10/20 20:16:58 stdout
2023/10/20 20:16:58 stdout ╚══════╝╚══════╝╚═╝ ╚═════╝
2023/10/20 20:16:58 stdout ███████╗███████║██║╚██████╔╝
2023/10/20 20:16:58 stdout ██║ ╚════██║██║██║ ██║
2023/10/20 20:16:58 stdout ██║ ███████╗██║██║ ██║
2023/10/20 20:16:58 stdout ██║ ██╔════╝██║██╔═══██╗
2023/10/20 20:16:58 stdout ██╗ ███████╗██╗ ██████╗
2023/10/20 20:16:58 stdout
2023/10/20 20:16:58 stdout ───────────────────────────────────────
2023/10/20 20:16:56 stdout [migrations] no migrations found
2023/10/20 20:16:56 stdout [migrations] started

Your issue is caused by the Synology GUI: Known Issue: Portainer & Synology Docker UI | Info :: LinuxServer.io

Cool, thanks.

Based on this I nuked the entire container and re-created it. It still didn’t work, but:

I then deleted all files in the bazarr folder (which means starting from scratch obviously, all profiles lost) and that worked.

So if anyone ends up here in the future, basically the solution is to completely redo your config/database, aka delete all files from bazarr and recreate the container.

This is not correct. Please do not do this.

The solution is not to nuke the config folder and starting from scratch.

The proper solution and the underlying issue are explained in the link above. Google searches also reveal plenty of other explanations.

Well, the page linked above says " Our position remains that we provide support only for containers created and updated using Docker Compose, the Docker CLI, or using our Unraid templates, and not any 3rd party tools.".

So I just figured it out myself, and got it working by redoing my bazarr install from scratch. Re-creating the container didn’t fix it until the entire db was reset for me. The best post I found online about similar issues to what I was getting was this one.

If there’s another solution I don’t know what it is, so I just posted what worked for me to avoid other people to have to play a riddle game as no amount of googling game me a way to fix it.

I can also confirm that removing the container and creating from scratch does not help. When I shell into the container, I can reproduce the error. It seems the version of python shipped here doesn’t have pkg_resources

The cause of the issue reported in this thread has already been identified and mentioned above. The solution is to use docker run on the cli or docker compose with a yaml file and docker compose up -d from the cli. Tl;dr dont use synology’s ui or portainer. If that isnt the case for you, then you are not confirming things because you have a different issue.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.