morpheus65535 / bazarr

Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.
https://www.bazarr.media
GNU General Public License v3.0
2.85k stars 223 forks source link

Error syncing tv shows from sonarr #2291

Closed EmoKarTmp closed 12 months ago

EmoKarTmp commented 12 months ago

Describe the bug When the sync task for sonarr runs it is throwing an exception and I end up with no episodes synced.

To Reproduce Steps to reproduce the behavior: Trigger a sync of episodes

Expected behavior Episodes sync

Screenshots Traceback (most recent call last):  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\engine\base.py", line 1964, in _exec_single_context    self.dialect.do_execute(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\engine\default.py", line 748, in do_execute    cursor.execute(statement, parameters)sqlite3.OperationalError: near "RETURNING": syntax errorThe above exception was the direct cause of the following exception:Traceback (most recent call last):  File "c:\program files\bazarr\bazarr../libs\apscheduler\executors\base.py", line 125, in run_job    retval = job.func(*job.args, **job.kwargs)  File "c:\program files\bazarr\bazarr\sonarr\sync\series.py", line 100, in update_series    sync_episodes(series_id=show['id'], send_event=send_event)  File "c:\program files\bazarr\bazarr\sonarr\sync\episodes.py", line 116, in sync_episodes    added_episodes = database.execute(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\orm\scoping.py", line 724, in execute    return self._proxied.execute(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\orm\session.py", line 2229, in execute    return self._execute_internal(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\orm\session.py", line 2124, in _execute_internal    result: Result[Any] = compile_state_cls.orm_execute_statement(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\orm\bulk_persistence.py", line 1225, in orm_execute_statement    result = conn.execute(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\engine\base.py", line 1414, in execute    return meth(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\sql\elements.py", line 486, in _execute_on_connection    return connection._execute_clauseelement(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\engine\base.py", line 1638, in _execute_clauseelement    ret = self._execute_context(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\engine\base.py", line 1842, in _execute_context    return self._exec_single_context(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\engine\base.py", line 1983, in _exec_single_context    self._handle_dbapi_exception(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\engine\base.py", line 2326, in _handle_dbapi_exception    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\engine\base.py", line 1964, in _exec_single_context    self.dialect.do_execute(  File "c:\program files\bazarr\bazarr../libs\sqlalchemy\engine\default.py", line 748, in do_execute    cursor.execute(statement, parameters)sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "RETURNING": syntax error[SQL: INSERT INTO table_episodes (audio_codec, audio_language, episode, episode_file_id, file_size, format, monitored, path, resolution, "sceneName", season, "sonarrEpisodeId", "sonarrSeriesId", title, video_codec) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "sonarrEpisodeId", path, "sonarrSeriesId"][parameters: ('EAC3', "['English']", 1, 5150, 2686066629, 'WEBDL', 'True', 'E:\TVShows\The Continental (2023)\Season01\The Continental (2023) - S01E01 - Night 1 - Brothers in Arms.mkv', '1080p', 'The.Continental.From.the.World.of.John.Wick.S01E01.1080p.WEB.H265-RAW', 1, 6907, 167, 'Night 1: Brothers in Arms', 'h265', 'EAC3 Atmos', "['English']", 2, 5151, 2643823066, 'WEBDL', 'True', 'E:\TVShows\The Continental (2023)\Season01\The Continental (2023) - S01E02 - Night 2 - Loyalty to the Master.mkv', '1080p', 'The.Continental.From.the.World.of.John.Wick.S01E02.1080p.WEB.H265-RAW', 1, 6908, 167, 'Night 2: Loyalty to the Master', 'h265', 'EAC3', "['English']", 3, 5154, 5824131038, 'WEBDL', 'True', 'E:\TVShows\The Continental (2023)\Season01\The Continental (2023) - S01E03 - Night 3 - Theater of Pain.mkv', '1080p', 'The.Continental.S01E03.1080p.WEB.h264-ETHEL[TGx]', 1, 6909, 167, 'Night 3: Theater of Pain', 'h264')](Background on this error at: https://sqlalche.me/e/20/e3q8)

Software (please complete the following information):

Additional context n/a

morpheus65535 commented 12 months ago

Duplicate #2281