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

Stuck trying to analyze files that does not exist anymore #2255

Closed rmichelena closed 1 year ago

rmichelena commented 1 year ago

Describe the bug I see in my log a few failure messages of the kind: BAZARR Error ([Errno 2] No such file or directory: and the video files it's trying to open, are files that do not exist anymore, some for a long time (days or weeks), since Sonarr or Radarr replaced them by better versions (or renamed them because of naming scheme changes). In some cases it's even trying to process two generations back! As per log copied below: this file Ahsoka S01E03, was first downloaded as KAG, then ELITE, and finally Goki (the current one). And it's trying to analyze both KAG and ELITE (Goki had embedded subs)

To Reproduce Probably the reason is a file was downloaded by Radarr or Sonarr, and very shortly replaced by another version (as can happen with Radarr and Sonarr); some interplay between Bazarr's syncing schedule and the times on which these occurred... Also at least in one case, it's due to file renaming from Sonarr (added release group to name).

Software (please complete the following information):

Traceback (most recent call last):
  File "/app/bin/bazarr/subtitles/utils.py", line 41, in get_video
    video = parse_video(path, hints=hints, skip_hashing=skip_hashing, dry_run=used_scene_name, providers=providers,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bin/bazarr/../libs/subzero/video.py", line 61, in parse_video
    return scan_video(fn, hints=hints, dont_use_actual_file=dry_run, providers=providers,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bin/bazarr/../libs/subliminal_patch/core.py", line 834, in scan_video
    video.size = os.path.getsize(hash_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen genericpath>", line 50, in getsize
FileNotFoundError: [Errno 2] No such file or directory: \'/tv/Ahsoka/Season 1/Ahsoka - S01E03 - Part Three [WEBRip-1080p] -KAF.mkv\

Traceback (most recent call last):
  File "/app/bin/bazarr/subtitles/utils.py", line 41, in get_video
    video = parse_video(path, hints=hints, skip_hashing=skip_hashing, dry_run=used_scene_name, providers=providers,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bin/bazarr/../libs/subzero/video.py", line 61, in parse_video
    return scan_video(fn, hints=hints, dont_use_actual_file=dry_run, providers=providers,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bin/bazarr/../libs/subliminal_patch/core.py", line 834, in scan_video
    video.size = os.path.getsize(hash_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen genericpath>", line 50, in getsize
FileNotFoundError: [Errno 2] No such file or directory: \'/tv/Ahsoka/Season 1/Ahsoka - S01E03 - Part Three [HDTV-1080p] -ELiTE.mkv\
morpheus65535 commented 1 year ago

Did you try to run the Sync with Sonarr task to fix this?

Can you provide a debug log if it doesn't fix it? Maybe there's some sort of conflict.

rmichelena commented 1 year ago

It does sync with Sonarr as per schedule, nothing shows in the logs but it does pick up new entries. Anyway, enabled the debug log, manually triggered a sync, downloaded the log; attached. I checked it and see no error message; also, the shows in question (Ahsoka, Foundation) both seem to sync fine. It not only happens with shows, it also happens with movies; similar case, a movie was downloaded and just a few minutes later upgraded. Bazarr keeps trying to analyze the old (no longer existing) movie file.

bazarr-2.log

morpheus65535 commented 1 year ago

In that case, Bazarr probably didn't receive a notification through SignalR (LIVE tag?). When you force a sync, is the path still wrong?

rmichelena commented 1 year ago

we'll see; I did manually sync with both Sonarr and Radarr and will wait to see if this keeps happening however, we're talking about files that were deleted some days ago or more - even if no live notification had been received, scheduled sync would've cleared them up already, wouldn't it?

morpheus65535 commented 1 year ago

Yes it should. If it doesn't fix it, I'm gonna need the API output from Sonarr or Radarr API and your database to understand why it doesn't get updated.

rmichelena commented 1 year ago

well, keeps doing it ; here I attach my database. How do I get the API output from Sonarr o Radarr ? bazarr.db.zip

morpheus65535 commented 1 year ago

Can you provide an upgrade debug log?

rmichelena commented 1 year ago

wrong thread... this one is about Bazarr trying to parse files that do not exist... does not happen related to upgrade afaik

morpheus65535 commented 1 year ago

Sorry, doing too much stuff at the same time lol

morpheus65535 commented 1 year ago

How do I get the API output from Sonarr o Radarr ?

http://sonarr:8989/api/v3/episode?seriesId=188&apikey=

morpheus65535 commented 1 year ago

Still an issue here? You didn't provided the Sonarr API output.

morpheus65535 commented 1 year ago

1 month later: no news, good news!