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.89k stars 225 forks source link

Whisper 24h timeout when searching for subs while processing #2757

Closed dovry closed 1 week ago

dovry commented 1 week ago

Describe the bug

If whisperAI is currently transcribing subs, searching for subs on additional media times whisper provider out for 24 hours

To Reproduce Steps to reproduce the behavior:

  1. search for subs on media
  2. wait for WhisperAI to receive packets and start processing it
  3. search for subs on different media 3.1 might have to do this 2 or 3 times before it times out
  4. System > Providers should now display a 24h timeout with 'Connection Error' under Status

Expected behavior Subsequent media to be added to the queue successfully

Screenshots image

Software (please complete the following information):

Additional context Hitting 'Search All' under Wanted does run random media from said list for about 3-4 hours before it times out in a similar fashion

Log

2024-11-12 13:11:47,465 - subliminal_patch.providers.whisperai (7f448c261b30) :  INFO (whisperai:357) - Starting WhisperAI transcribe to English for /tv/random_tvshow/Season 06/random_tvshow - S06E05 - Episode 5 WEBDL-1080p.mkv
2024-11-12 13:11:47,535 - urllib3.connectionpool           (7f448c261b30) :  DEBUG (connectionpool:244) - Starting new HTTP connection (5): 10.0.0.121:9101
2024-11-12 13:11:53,795 - engineio.server                  (7f44774f1b30) :  INFO (socket:76) - 73jH1EdE3taacwdxAAAA: Sending packet PING data None
2024-11-12 13:11:53,801 - engineio.server                  (7f448d349b30) :  INFO (socket:39) - 73jH1EdE3taacwdxAAAA: Received packet PONG data 
2024-11-12 13:11:57,546 - retry.api                        (7f448c261b30) :  WARNING (api:40) - ('Connection aborted.', TimeoutError('timed out')), retrying in 5 seconds...
2024-11-12 13:11:59,820 - engineio.server                  (7f447a50db30) :  INFO (socket:76) - fFMk8TNM3qT139eiAAAG: Sending packet PING data None
2024-11-12 13:11:59,826 - engineio.server                  (7f448b179b30) :  INFO (socket:39) - fFMk8TNM3qT139eiAAAG: Received packet PONG data 
2024-11-12 13:12:02,619 - urllib3.connectionpool           (7f448c261b30) :  DEBUG (connectionpool:244) - Starting new HTTP connection (6): 10.0.0.121:9101
2024-11-12 13:12:12,631 - retry.api                        (7f448c261b30) :  WARNING (api:40) - ('Connection aborted.', TimeoutError('timed out')), retrying in 5 seconds...
2024-11-12 13:12:17,741 - urllib3.connectionpool           (7f448c261b30) :  DEBUG (connectionpool:244) - Starting new HTTP connection (7): 10.0.0.121:9101
2024-11-12 13:12:18,803 - engineio.server                  (7f447ee4bb30) :  INFO (socket:76) - 73jH1EdE3taacwdxAAAA: Sending packet PING data None
2024-11-12 13:12:18,808 - engineio.server                  (7f448a2aeb30) :  INFO (socket:39) - 73jH1EdE3taacwdxAAAA: Received packet PONG data 
2024-11-12 13:12:24,827 - engineio.server                  (7f447e35fb30) :  INFO (socket:76) - fFMk8TNM3qT139eiAAAG: Sending packet PING data None
2024-11-12 13:12:24,834 - engineio.server                  (7f4489a3ab30) :  INFO (socket:39) - fFMk8TNM3qT139eiAAAG: Received packet PONG data 
2024-11-12 13:12:27,754 - subliminal_patch.core            (7f448c261b30) :  ERROR (core:492) - Provider 'whisperai' connection error
2024-11-12 13:12:27,756 - root                             (7f448c261b30) :  INFO (get_providers:392) - Throttling whisperai for 24 hours, until 24/11/13 13:12, because of: ConnectionError. Exception info: "'('Connection aborted.', TimeoutError('timed out'))' ~ whisperai.py@360"
2024-11-12 13:12:27,757 - socketio.server                  (7f448c261b30) :  INFO (server:161) - emitting event "data" to all [/]
2024-11-12 13:12:27,757 - engineio.server                  (7f448c261b30) :  INFO (socket:76) - 73jH1EdE3taacwdxAAAA: Sending packet MESSAGE data 2["data",{"type":"badges","action":"update","payload":null}]
2024-11-12 13:12:27,758 - engineio.server                  (7f448c261b30) :  INFO (socket:76) - fFMk8TNM3qT139eiAAAG: Sending packet MESSAGE data 2["data",{"type":"badges","action":"update","payload":null}]
2024-11-12 13:12:27,758 - subliminal_patch.core            (7f448c261b30) :  DEBUG (core:512) - Errors while downloading subtitle, retrying provider 'whisperai' in 6 seconds
2024-11-12 13:12:28,003 - urllib3.connectionpool           (7f4488952b30) :  DEBUG (connectionpool:244) - Starting new HTTP connection (1): sonarr:8989
2024-11-12 13:12:28,004 - urllib3.connectionpool           (7f4488952b30) :  DEBUG (connectionpool:549) - http://sonarr:8989 "GET /api/system/status?apikey=c7cd55cc571e42d081506648cbf04ea7 HTTP/1.1" 404 0
JaiZed commented 1 week ago

Bazarr was designed around subtitle providers that when queried, return the subtitle file almost immediately. There is no queue of requests that are pending. If you ask whisper to process a file while it's still busy with the prior one, it will not respond and then Bazarr will think the provider is broken and will ban it temporarily. Or, depending on the implementation, whisper might ignore it completely.

If you allow Bazarr to work in an automatic fashion, then it will eventually process all the subtitles. If you do too many manual searches too quickly, then you will run into this issue. That's just the way Bazarr is designed and it is not likely to be changed to support this.