Closed SteffanCline closed 1 month ago
Did you tried development branch? I've updated multiple libraries and it may improve the results.
Got frustrated with pip and forced it pip install -r requirements.txt --break-system-packages
This is from the dev branch
# /usr/bin/python3 /opt/Bazarr/bazarr.py
Python version greater than 3.11.x is unsupported. Current version is 3.12.3. Keep in mind that even if it works, you're on your own.
Bazarr starting child process with PID 1351192...
Traceback (most recent call last):
File "/opt/Bazarr/bazarr/main.py", line 37, in <module>
check_if_new_update()
File "/opt/Bazarr/bazarr/app/check_update.py", line 105, in check_if_new_update
download_release(url=release['download_link'])
File "/opt/Bazarr/bazarr/app/check_update.py", line 136, in download_release
apply_update()
File "/opt/Bazarr/bazarr/app/check_update.py", line 190, in apply_update
from .server import webserver
File "/opt/Bazarr/bazarr/app/server.py", line 13, in <module>
from api import api_bp
File "/opt/Bazarr/bazarr/api/__init__.py", line 6, in <module>
from .badges import api_ns_list_badges
File "/opt/Bazarr/bazarr/api/badges/__init__.py", line 3, in <module>
from .badges import api_ns_badges
File "/opt/Bazarr/bazarr/api/badges/badges.py", line 11, in <module>
from app.signalr_client import sonarr_signalr_client, radarr_signalr_client
File "/opt/Bazarr/bazarr/app/signalr_client.py", line 25, in <module>
from .scheduler import scheduler
File "/opt/Bazarr/bazarr/app/scheduler.py", line 332, in <module>
scheduler = Scheduler()
^^^^^^^^^^^
File "/opt/Bazarr/bazarr/app/scheduler.py", line 90, in __init__
self.update_configurable_tasks()
File "/opt/Bazarr/bazarr/app/scheduler.py", line 102, in update_configurable_tasks
self.__randomize_interval_task()
File "/opt/Bazarr/bazarr/app/scheduler.py", line 323, in __randomize_interval_task
timedelta(seconds=randrange(
^^^^^^^^^^
File "/usr/lib/python3.12/random.py", line 301, in randrange
istart = _index(start)
^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer
Can you make this line:
File "/opt/Bazarr/bazarr/app/scheduler.py", line 324
job.trigger.interval.total_seconds() * 0.75,
Looks like this:
int(job.trigger.interval.total_seconds() * 0.75),
This should fix this single issue, lets hope there's not much more.
Using the prod version with your changes I get:
# /usr/bin/python3 /opt/Bazarr/bazarr.py
Python version greater than 3.11.x is unsupported. Current version is 3.12.3. Keep in mind that even if it works, you're on your own.
Bazarr starting...
Traceback (most recent call last):
File "/opt/Bazarr/bazarr/main.py", line 22, in <module>
from init import * # noqa E402
^^^^^^^^^^^^^^^^^^
File "/opt/Bazarr/bazarr/init.py", line 21, in <module>
from app.database import init_db
File "/opt/Bazarr/bazarr/app/database.py", line 7, in <module>
import flask_migrate
File "/opt/Bazarr/bazarr/../libs/flask_migrate/__init__.py", line 7, in <module>
from alembic import __version__ as __alembic_version__
File "/opt/Bazarr/bazarr/../libs/alembic/__init__.py", line 3, in <module>
from . import context
File "/opt/Bazarr/bazarr/../libs/alembic/context.py", line 1, in <module>
from .runtime.environment import EnvironmentContext
File "/opt/Bazarr/bazarr/../libs/alembic/runtime/environment.py", line 15, in <module>
from .migration import _ProxyTransaction
File "/opt/Bazarr/bazarr/../libs/alembic/runtime/migration.py", line 20, in <module>
from sqlalchemy import Column
File "/opt/Bazarr/bazarr/../libs/sqlalchemy/__init__.py", line 12, in <module>
from . import util as _util
File "/opt/Bazarr/bazarr/../libs/sqlalchemy/util/__init__.py", line 15, in <module>
from ._collections import coerce_generator_arg as coerce_generator_arg
File "/opt/Bazarr/bazarr/../libs/sqlalchemy/util/_collections.py", line 39, in <module>
from .typing import Literal
File "/opt/Bazarr/bazarr/../libs/sqlalchemy/util/typing.py", line 35, in <module>
from typing_extensions import Annotated as Annotated # 3.8
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Bazarr/bazarr/../libs/typing_extensions.py", line 1167, in <module>
class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
Bazarr exited.
Using the dev I get:
# /usr/bin/python3 /opt/Bazarr.dev/bazarr.py
Python version greater than 3.11.x is unsupported. Current version is 3.12.3. Keep in mind that even if it works, you're on your own.
Bazarr starting child process with PID 2629709...
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/core.py:594: SyntaxWarning: invalid escape sequence '\*'
"""Refine a video using :ref:`refiners`.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/core.py:622: SyntaxWarning: invalid escape sequence '\*'
"""List subtitles.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/core.py:663: SyntaxWarning: invalid escape sequence '\*'
"""Download :attr:`~subliminal.subtitle.Subtitle.content` of `subtitles`.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/core.py:680: SyntaxWarning: invalid escape sequence '\*'
"""List and download the best matching subtitles.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/extensions.py:9: SyntaxWarning: invalid escape sequence '\*'
""":class:~stevedore.extensions.ExtensionManager` with support for registration.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/video.py:118: SyntaxWarning: invalid escape sequence '\*'
"""Episode :class:`Video`.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/video.py:205: SyntaxWarning: invalid escape sequence '\*'
"""Movie :class:`Video`.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/refiners/__init__.py:1: SyntaxWarning: invalid escape sequence '\*'
"""
/opt/Bazarr.dev/bazarr/../custom_libs/subzero/language.py:165: SyntaxWarning: invalid escape sequence '\.'
IETF_MATCH = ".+\.([^-.]+)(?:-[A-Za-z]+)?$"
/opt/Bazarr.dev/bazarr/../custom_libs/subzero/language.py:166: SyntaxWarning: invalid escape sequence '\.'
ENDSWITH_LANGUAGECODE_RE = re.compile("\.([^-.]{2,3})(?:-[A-Za-z]{2,})?$")
/opt/Bazarr.dev/bazarr/../custom_libs/subzero/language.py:170: SyntaxWarning: invalid escape sequence '\.'
language_match = re.match(".+\.([^\.]+)$" if not ietf
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal_patch/core.py:1060: SyntaxWarning: invalid escape sequence '\*'
"""Download :attr:`~subliminal.subtitle.Subtitle.content` of `subtitles`.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal_patch/core.py:1077: SyntaxWarning: invalid escape sequence '\*'
"""List and download the best matching subtitles.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal_patch/core.py:1248: SyntaxWarning: invalid escape sequence '\*'
"""Refine a video using :ref:`refiners`.
/opt/Bazarr.dev/bazarr/../custom_libs/libfilebot/main.py:53: SyntaxWarning: invalid escape sequence '\.'
lambda result: re.search('(?um)(net\.filebot\.filename(?=="|: )[=:" ]+|Attribute.+:\s)([^"\n\r\0]+)',
/opt/Bazarr.dev/bazarr/../custom_libs/libfilebot/main.py:63: SyntaxWarning: invalid escape sequence '\.'
lambda result: re.search('(?um)(net\.filebot\.filename(?=="|: )[=:" ]+|Attribute.+:\s)([^"\n\r\0]+)',
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal_patch/providers/legendasdivx.py:327: SyntaxWarning: invalid escape sequence '\d'
querytext = re.sub("(e|E)(\d{2})", "", querytext)
/opt/Bazarr.dev/bazarr/../custom_libs/subscene_api/subscene.py:67: SyntaxWarning: invalid escape sequence '\s'
url = re.sub("\s", "+", url)
^CHandling keyboard interrupt...
Traceback (most recent call last):
File "/opt/Bazarr.dev/bazarr/main.py", line 37, in <module>
check_if_new_update()
File "/opt/Bazarr.dev/bazarr/app/check_update.py", line 105, in check_if_new_update
download_release(url=release['download_link'])
File "/opt/Bazarr.dev/bazarr/app/check_update.py", line 136, in download_release
apply_update()
File "/opt/Bazarr.dev/bazarr/app/check_update.py", line 168, in apply_update
with open(file_path, 'wb+') as f:
KeyboardInterrupt
^CStop doing that! I heard you the first time!
Terminated
While waiting, I was able to install python3.11.9 on Ubuntu 24 Noble following the instructions here https://radwanelourhmati7.medium.com/installing-python-3-11-on-ubuntu-step-by-step-a46631d4e293 with a small change I did a ./configure --enable-optimizations --with-assertions
and then a fresh bazarr release and retry. Made some progress. Made sure to do a pip3.11 install -r requirements.txt.
Now I'm down to this:
# /usr/local/bin/python3.11 /opt/Bazarr/bazarr.py
Bazarr starting...
/root/.local/lib/python3.11/site-packages/_distutils_hack/__init__.py:11: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
warnings.warn(
/root/.local/lib/python3.11/site-packages/_distutils_hack/__init__.py:26: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Traceback (most recent call last):
File "/opt/Bazarr/bazarr/main.py", line 22, in <module>
from init import * # noqa E402
^^^^^^^^^^^^^^^^^^
File "/opt/Bazarr/bazarr/init.py", line 82, in <module>
import lxml, numpy, webrtcvad, setuptools, PIL # noqa E401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/setuptools/__init__.py", line 8, in <module>
import _distutils_hack.override # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/_distutils_hack/override.py", line 1, in <module>
__import__('_distutils_hack').do_override()
File "/root/.local/lib/python3.11/site-packages/_distutils_hack/__init__.py", line 70, in do_override
ensure_local_distutils()
File "/root/.local/lib/python3.11/site-packages/_distutils_hack/__init__.py", line 57, in ensure_local_distutils
assert '_distutils' in core.__file__, core.__file__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: /usr/local/lib/python3.11/distutils/core.py
Bazarr exited.
Update setuptools using /usr/local/bin/python3.11 -m pip install -U setuptools
.
I'm working to add basic compatibility for Python 3.12. I don't have a lot of spare time so it could take a while.
I'm working to add basic compatibility for Python 3.12. I don't have a lot of spare time so it could take a while.
I figured as much which is why I installed Python 3.11 to solve the problem but this is the hangup now. Not sure how to fix it.
I think I have it working however ran into an error. Perhaps an upgrade issue?
BAZARR cannot update movie /my/path/Some Movie (1994)/Some Movie -480p.mkv because of (sqlite3.IntegrityError) UNIQUE constraint failed: table_movies.path
[SQL: UPDATE table_movies SET "alternativeTitles"=?, audio_codec=?, audio_language=?, fanart=?, file_size=?, format=?, "imdbId"=?, monitored=?, movie_file_id=?, overview=?, path=?, poster=?, "radarrId"=?, resolution=?, "sceneName"=?, "sortTitle"=?, tags=?, title=?, "tmdbId"=?, video_codec=?, year=? WHERE table_movies."tmdbId" = ?]
[parameters: ('[]', 'MP3', "['English']", '', 539291097, 'WEBDL', 'tt0111587', 'True', 27506, 'The continuing saga of ....', '/my/path/Some Movie (1994)/Some Movie -480p.mkv', '/radarr/MediaCover/5250/poster-500.jpg?lastWrite=638376131735605641', 5250, '480p', None, 'some movie', '[]', 'Some Movie', '372988', 'h264', '1994', '372988')]
(Background on this error at: https://sqlalche.me/e/20/gkpj)
Specifically UNIQUE constraint failed: table_movies.path
Here's how I got it to work using the normal Bazarr release on Ubuntu 24 Noble. This also works for Tautulli as well.
/usr/lib/systemd/system/bazarr.service
to show
[Unit]
Description=Bazarr Daemon
After=syslog.target network.target
[Service] User=bazarr Group=media UMask=0002
SyslogIdentifier=bazarr
Type=simple ExecStart=/usr/local/bin/python3.11 /opt/Bazarr/bazarr.py TimeoutStopSec=60 KillMode=process Restart=on-failure
[Install] WantedBy=multi-user.target
17. systemctl daemon-reload
18. systemctl start bazarr
The only thing remaining is the error I posted above about the unique constraint.
It should be good now (at least for testing purpose) with Python 3.12:
Let me know if it works fine for you.
Should I test with the dev branch again?
Yes you can get latest bazarr.zip asset there: https://github.com/morpheus65535/bazarr/releases/tag/v1.4.3-beta.24
The dev branch is working somewhat with 3.12... I still see the unique constraint issue. Not sure about the other parts.
plex:/opt/Bazarr.dev# python3 bazarr.py
Python version greater than 3.11.x is unsupported. Current version is 3.12.3. Keep in mind that even if it works, you're on your own.
Bazarr starting child process with PID 2046514...
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/extensions.py:9: SyntaxWarning: invalid escape sequence '\*'
""":class:~stevedore.extensions.ExtensionManager` with support for registration.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/video.py:118: SyntaxWarning: invalid escape sequence '\*'
"""Episode :class:`Video`.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/video.py:205: SyntaxWarning: invalid escape sequence '\*'
"""Movie :class:`Video`.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal/refiners/__init__.py:1: SyntaxWarning: invalid escape sequence '\*'
"""
/opt/Bazarr.dev/bazarr/../custom_libs/subzero/language.py:165: SyntaxWarning: invalid escape sequence '\.'
IETF_MATCH = ".+\.([^-.]+)(?:-[A-Za-z]+)?$"
/opt/Bazarr.dev/bazarr/../custom_libs/subzero/language.py:166: SyntaxWarning: invalid escape sequence '\.'
ENDSWITH_LANGUAGECODE_RE = re.compile("\.([^-.]{2,3})(?:-[A-Za-z]{2,})?$")
/opt/Bazarr.dev/bazarr/../custom_libs/subzero/language.py:170: SyntaxWarning: invalid escape sequence '\.'
language_match = re.match(".+\.([^\.]+)$" if not ietf
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal_patch/core.py:1060: SyntaxWarning: invalid escape sequence '\*'
"""Download :attr:`~subliminal.subtitle.Subtitle.content` of `subtitles`.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal_patch/core.py:1077: SyntaxWarning: invalid escape sequence '\*'
"""List and download the best matching subtitles.
/opt/Bazarr.dev/bazarr/../custom_libs/subliminal_patch/core.py:1248: SyntaxWarning: invalid escape sequence '\*'
"""Refine a video using :ref:`refiners`.
/opt/Bazarr.dev/bazarr/../custom_libs/libfilebot/main.py:53: SyntaxWarning: invalid escape sequence '\.'
lambda result: re.search('(?um)(net\.filebot\.filename(?=="|: )[=:" ]+|Attribute.+:\s)([^"\n\r\0]+)',
/opt/Bazarr.dev/bazarr/../custom_libs/libfilebot/main.py:63: SyntaxWarning: invalid escape sequence '\.'
lambda result: re.search('(?um)(net\.filebot\.filename(?=="|: )[=:" ]+|Attribute.+:\s)([^"\n\r\0]+)',
2024-04-23 21:33:07,391 - root (701e2b4006c0) : INFO (signalr_client:122) - BAZARR trying to connect to Sonarr SignalR feed...
2024-04-23 21:33:07,397 - root (701e2aa006c0) : INFO (signalr_client:189) - BAZARR trying to connect to Radarr SignalR feed...
2024-04-23 21:33:07,397 - root (701f781e6300) : INFO (server:79) - BAZARR is started and waiting for request on http://0.0.0.0:6767
2024-04-23 21:33:07,412 - root (701e2a0006c0) : INFO (signalr_client:150) - BAZARR SignalR client for Sonarr is connected and waiting for events.
2024-04-23 21:33:07,445 - root (701e2b4006c0) : INFO (signalr_client:217) - BAZARR SignalR client for Radarr is connected and waiting for events.
2024-04-23 21:33:39,986 - root (701e1fe006c0) : ERROR (movies:51) - BAZARR cannot update movie /storage/Media/Movies/Vanishing Son (1994)/Vanishing Son -480p.mkv because of (sqlite3.IntegrityError) UNIQUE constraint failed: table_movies.path
[SQL: UPDATE table_movies SET "alternativeTitles"=?, audio_codec=?, audio_language=?, fanart=?, file_size=?, format=?, "imdbId"=?, monitored=?, movie_file_id=?, overview=?, path=?, poster=?, "radarrId"=?, resolution=?, "sceneName"=?, "sortTitle"=?, tags=?, title=?, "tmdbId"=?, video_codec=?, year=? WHERE table_movies."tmdbId" = ?]
[parameters: ('[]', 'MP3', "['English']", '', 539291097, 'WEBDL', 'tt0111587', 'True', 27506, 'The continuing saga of the Chang brothers: Jian-Wa and Wago. Picking up where it left off, Jian-Wa has left L.A. after a gangfight which involved his ... (147 characters truncated) ... ermen. Jian-wa decides to side with the Vietnamese and help them defend themselves. Back in Los Angeles, Wago is enjoying his new life as a gangster.', '/storage/Media/Movies/Vanishing Son (1994)/Vanishing Son -480p.mkv', '/radarr/MediaCover/5250/poster-500.jpg?lastWrite=638376131735605641', 5250, '480p', None, 'vanishing son ii', '[]', 'Vanishing Son II', '372988', 'h264', '1994', '372988')]
(Background on this error at: https://sqlalche.me/e/20/gkpj)
On a different note, with Python 3.11, the master branch threw this error below in syslog.
What is causing that error BAZARR Cannot create restart file: KeyError('RESTARTFILE')
?
Apr 22 00:37:36 plex bazarr[21230]: Closing database...
Apr 22 00:37:36 plex bazarr[21230]: Closing webserver...
Apr 22 00:37:36 plex bazarr[21230]: 2024-04-22 00:37:36,951 - root (7c36d8c006c0) : ERROR (central:46) - BAZARR Cannot create restart file: KeyError('RESTARTFILE')
Apr 22 00:37:36 plex bazarr[21230]: 2024-04-22 00:37:36,952 - root (7c36d8c006c0) : INFO (central:47) - Bazarr is being restarted...
Apr 22 00:37:36 plex bazarr[21230]: 2024-04-22 00:37:36,957 - apscheduler.executors.default (7c36d8c006c0) : ERROR (base:131) - Job "Update Bazarr (trigger: interval[6:00:00], next run at: 2024-04-22 06:37:30 MST)" raised an exception
Apr 22 00:37:49 plex bazarr[21230]: 2024-04-22 00:37:49,167 - apscheduler.executors.default (7c36cfe006c0) : ERROR (base:131) - Job "Search for Missing Series Subtitles (trigger: interval[6:00:00], next run at: 2024-04-22 01:52:38 MST)" raised an exception
Apr 22 00:37:50 plex bazarr[21227]: Bazarr starting...
Apr 22 00:37:50 plex bazarr[21227]: Bazarr exited.
Apr 22 00:37:50 plex systemd[1]: bazarr.service: Deactivated successfully.
Apr 22 00:37:50 plex systemd[1]: bazarr.service: Consumed 1h 6min 32.466s CPU time, 516.6M memory peak, 0B memory swap peak.
What is causing that error
BAZARR Cannot create restart file: KeyError('RESTARTFILE')
?
Fixed in dev branch.
This fix should take care of the SyntaxWarning. The unique constraint is because you're trying to update a movie with a path already present for another one.
The unique constraint is because you're trying to update a movie with a path already present for another one.
How do I fix that??
How do I fix that??
Check first if you have the same movie indexed multiple time (Vanishing Son (1994)). If not, we may have a problem with the sync logic but it's hard to say without knowing the exact sequence of events. Did you made change to this movies recently?
No news, good news!
Describe the bug I made the mistake of updating to Ubuntu 24 to fix some other issues and didn't think of compatibility with a few of the packages. Ubuntu 24 uses Python 3.12.3. Are there any plans to update the code to support the newer Python or is there a compat package that can be installed to resolve this?
To Reproduce Steps to reproduce the behavior: Upgrade from Ubuntu 22 to 24 and then Bazarr no longer starts due to incompatibility with the newer python.
Expected behavior Hoping to find a way to restore functionality.
Software (please complete the following information):
Additional context