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.78k stars 218 forks source link

Bazarr fails to read either episodes or movies from disk when "Use cached embedded subtitles parser results" is checked on #2118

Closed vkojchevski closed 1 year ago

vkojchevski commented 1 year ago

Describe the bug Bazarr fails to read either episodes or movies from disk when "Use cached embedded subtitles parser results" is checked on for both movies and series.

To Reproduce Steps to reproduce the behavior:

  1. Newly installed Bazarr
  2. Set all necessary settings to get language profiles assigned to the media and sonarr+radarr connections
  3. Bazarr correctly imports Sonarr/Radarr lists but fails to scan the disk for them
  4. Manual triggering of the related tasks results in errors "Failed to connect to backed" "Server offline"
  5. Browser page refresh removes the error screen and opens up Bazarr again, but manual scans trigger the same errors
  6. While turning off "Use cached embedded subtitles parser results" solves the problem initially, it comes back after a while

Expected behavior For Bazarr to correctly scan the media on the disk

Software (please complete the following information):

Additional context I apologize that I don't have screenshots or more logs, I was more concerned about Bazarr working again for a fresh influx of media that I had, that I didn't manage to grab more details and my setup has changed quite a bit now as I use PostgreSQL as a DB. However I was able to consistently reproduce the problem (made couple of "fresh" installs) and if need be I am willing to do the extra work to make a dummy setup to reproduce it.

Let me go into some detail. I recently had to remove Bazarr docker container (and its appdata), for unrelated reasons. So I made a fresh install and started configuring it. I made all the necessary changes to get it back to as it used to be before besides adding providers as I didn't want even the chance of Bazarr downloading new subtitles before it recognized its old ones. It properly connected and imported lists from Sonarr/Radarr and shows the "live" icon next to their respective headers.

However, after a day (enough for all scheduled tasks to run) I noticed that none of my existing subtitles are recognized (they are alongside the media file). Manually triggering the task to scan the disk results in the notification bubble showing for a brief moment, then soon after gives a server offline and failed to connect to backend error. Refreshing the page brings you back to Bazarr but triggering the same task results in the same errors. Logs didn't show anything obvious.

I've tried changing every relevant setting there is, making sure volume mapping is correct, trying both ffprobe and mediainfo. What made it work initially, was turning off "Use cached embedded subtitles parser results". However after a while the problem came back and any interaction (like initiating manual disk scan for a single movie) resulted in the same errors. I am currently using it with PostgreSQL DB and for now (couple of days) it is issue free.

vkojchevski commented 1 year ago

I wasn't able to submit this bug report sooner because of some health issues I had, so I apologize upfront if this issue was/is addressed in these past couple of weeks and please close the it if so.

morpheus65535 commented 1 year ago

I'm going to need the log file when you reproduce this issue. The frontend disconnecting from backend means that an unexpected exception have occurred in backend. It will be logged in Bazarr log file.

vkojchevski commented 1 year ago

I understand, I will run a dummy setup soon and get you the logs.

vkojchevski commented 1 year ago

I was able to reproduce the issue but not by the conditions I mentioned in my initial report. I was 100% sure I tested each settings combination before, but my recent testing shows otherwise.

Turns out the culprit was mediainfo all along and "Use cached embedded subtitles parser results" has no effect even though I was led to believe it was so before.

For sake of completeness of this report, I am attaching the log file.

Some time stamp comments: Manual "Update all Movie Subtitles from disk" scan - time: 15:16-15:17 Disable "Use cached embedded subtitles parser results" - 15:18 Manual restart of the container - 15:20 Change to ffprobe - 15:21 Movies updated successfully - 15:23 Change to mediainfo - 15:23 Manual restart of the container - 15:23

What I did is turn on debug logging, set language profiles and set up Sonarr/Radarr. It immediately starts to give the errors I mentioned before. At 15:21 I change to ffprobe to scan the movies, goes fine. Then I switch to mediainfo to test it on the series, which failed as before.

bazarr.log

It is clear to me that this isn't technically an issue with Bazarr itself, rather with the Linuxserver docker container. So I thank you for your time (and the awesome software you've made) and as far as I am concerned this issue can be closed. Please close it at your own discretion.

morpheus65535 commented 1 year ago

Thanks for the feedback!