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.87k stars 223 forks source link

PySRT errors jumps Bazarr to 100% of a CPU and makes the web UI unreachable #1374

Closed ThibaultNocchi closed 3 years ago

ThibaultNocchi commented 3 years ago

Describe the bug On its regular subtitles download, my Bazarr instance jumps to 100% of a core and I can't reach its web UI due to a timeout. I've pinpointed the time where it jumps, and it always at the same time this error pops up in the logs:

07/04/2021 10:53:45|ERROR |subliminal_patch.subtitle |PySRT-parsing failed, trying pysubs2|

I just restart and it works, but 3h later due to the fetching task it crashes again. :p

I've also removed the movie from the logs, "Promise at Dawn", and it doesn't crash anymore. So one of the fetched subs must be the cause.

To Reproduce Dunno, but I can help trying anything

Software (please complete the following information):

Additional context Here is the log around the error:

07/04/2021 10:53:28|DEBUG   |subliminal_patch.providers.subscene|Searching for movie results: 'Promise at Dawn'|
07/04/2021 10:53:36|DEBUG   |urllib3.connectionpool          |https://subscene.com:443 "POST /subtitles/searchbytitle HTTP/1.1" 200 None|
07/04/2021 10:53:36|DEBUG   |urllib3.connectionpool          |https://subscene.com:443 "POST /subtitles/la-promesse-de-laube-promise-at-dawn HTTP/1.1" 200 None|
07/04/2021 10:53:44|INFO    |subliminal_patch.providers.subscene|0 subtitles found|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.providers.opensubtitles|Wrong FPS (expected: 23.976, got: 25.000, continuing)|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.core           |<OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7736165/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:None]>: Found matches {'year', 'imdb_id', 'title'}|
07/04/2021 10:53:45|INFO    |subliminal_patch.score          |<OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7736165/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:None]>: Computing score for video <Movie ['Promise at Dawn', 2017]> with {'hearing_impaired': False}|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.score          |Adding imdb_id match equivalents|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.score          |Matched hearing_impaired|
07/04/2021 10:53:45|INFO    |subliminal_patch.score          |<OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7736165/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:None]>: Computed score 91 with final matches {'year', 'title', 'hearing_impaired', 'imdb_id'}|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.subtitle       |Treating blu-ray as disk-hd the same|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.subtitle       |Treating blu-ray as disk-hd the same|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.core           |<OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7735306/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:None]>: Found matches {'year', 'video_codec', 'title', 'imdb_id', 'source'}|
07/04/2021 10:53:45|INFO    |subliminal_patch.score          |<OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7735306/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:None]>: Computing score for video <Movie ['Promise at Dawn', 2017]> with {'hearing_impaired': False}|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.score          |Adding imdb_id match equivalents|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.score          |Matched hearing_impaired|
07/04/2021 10:53:45|INFO    |subliminal_patch.score          |<OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7735306/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:None]>: Computed score 100 with final matches {'year', 'video_codec', 'title', 'hearing_impaired', 'imdb_id', 'source'}|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.core           |<OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7735306/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:None]>: Trying to download subtitle with matches {'year', 'video_codec', 'title', 'hearing_impaired', 'imdb_id', 'source'}, score: 100; release(s):  Promise.at.Dawn.2017.Bluray.1080p.DTS-HD.x264-googletranslator|
07/04/2021 10:53:45|INFO    |subliminal_patch.core           |Downloading subtitle <OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7735306/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:None]>|
07/04/2021 10:53:45|INFO    |subliminal_patch.providers.opensubtitles|Downloading subtitle <OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7735306/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:None]>|
07/04/2021 10:53:45|DEBUG   |urllib3.connectionpool          |Starting new HTTPS connection (1): api.opensubtitles.org:443|
07/04/2021 10:53:45|DEBUG   |urllib3.connectionpool          |https://api.opensubtitles.org:443 "POST /xml-rpc HTTP/1.1" 200 46371|
07/04/2021 10:53:45|ERROR   |subliminal_patch.subtitle       |PySRT-parsing failed, trying pysubs2|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.subtitle       |Trying parsing with PySubs2|
07/04/2021 10:53:45|INFO    |subliminal_patch.subtitle       |Got format: srt|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.core           |All languages downloaded|
07/04/2021 10:53:45|INFO    |subliminal_patch.core           |Downloaded 1 subtitle(s)|
07/04/2021 10:53:45|DEBUG   |subliminal.core                 |Terminating initialized providers|
07/04/2021 10:53:45|INFO    |subliminal_patch.core           |Terminating provider opensubtitles|
07/04/2021 10:53:45|INFO    |subliminal_patch.core           |Terminating provider yifysubtitles|
07/04/2021 10:53:45|INFO    |subliminal_patch.core           |Terminating provider soustitreseu|
07/04/2021 10:53:45|INFO    |subliminal_patch.core           |Terminating provider subscene|
07/04/2021 10:53:45|INFO    |subliminal_patch.providers.subscene|Closing session|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.core           |Subtitle formats requested: ('srt',)|
07/04/2021 10:53:45|DEBUG   |subliminal_patch.core           |Saving <OpenSubtitlesSubtitle 'http://www.opensubtitles.org/en/subtitles/7735306/sid-45W711iQK5HeQVkz0rARYpS2nza/promise-at-dawn-en' [en:utf-8]> to '/movies/Radarr/Promise at Dawn (2017)/La.Promesse.De.L.Aube.2017.FRENCH.720p.BluRay.DTS.x264-LAPROMESSE.en.srt'|
07/04/2021 10:53:45|INFO    |subliminal_patch.subtitle       |Applying mods: ['remove_HI', 'OCR_fixes', 'common', 'fix_uppercase']|
07/04/2021 11:06:57|DEBUG   |apscheduler.scheduler           |Looking for jobs to run|
07/04/2021 11:46:11|WARNING |apscheduler.executors.default   |Run time of job "Update Series list from Sonarr (trigger: interval[0:01:00], next run at: 2021-04-07 11:33:27 CEST)" was missed by 0:13:44.237426|
07/04/2021 11:46:11|WARNING |apscheduler.executors.default   |Run time of job "Sync episodes with Sonarr (trigger: interval[0:05:00], next run at: 2021-04-07 11:36:21 CEST)" was missed by 0:14:50.237867|
07/04/2021 11:59:05|WARNING |apscheduler.executors.default   |Run time of job "Update Movie list from Radarr (trigger: interval[0:05:00], next run at: 2021-04-07 11:37:05 CEST)" was missed by 0:27:00.812370|
07/04/2021 12:51:31|INFO    |socketio.server                 |emitting event "event" to all [/]|
07/04/2021 13:04:32|WARNING |apscheduler.executors.default   |Run time of job "Update Release Info (trigger: interval[3:00:00], next run at: 2021-04-07 14:02:03 CEST)" was missed by 2:02:28.985309|
07/04/2021 13:30:37|INFO    |socketio.server                 |emitting event "event" to all [/]|
07/04/2021 14:22:51|INFO    |socketio.server                 |emitting event "event" to all [/]|
07/04/2021 14:49:05|INFO    |socketio.server                 |emitting event "event" to all [/]|
07/04/2021 15:01:51|DEBUG   |apscheduler.scheduler           |Next wakeup is due at 2021-04-07 11:33:27.163230+02:00 (in 15.970977 seconds)|
morpheus65535 commented 3 years ago

As you said, it's probably a corrupted subtitles. Unfortunately, I can't reproduce it.

ThibaultNocchi commented 3 years ago

Np I just disabled the movie :)

morpheus65535 commented 3 years ago

Let's keep it in case someone else get the same issue in the future and would like to refer to this one.