RemiRigal / Plex-Auto-Languages

Automated language selection for Plex TV Shows !
MIT License
476 stars 17 forks source link

plex-auto-languages seems to be causing plex server to endlessly run operations #104

Open itsANHonor opened 1 month ago

itsANHonor commented 1 month ago

While investigating why my server was running at high CPU loads, I discovered that my Plex server was endlessly looping through some sort of operation with plex-auto-languages. The behavior would always occur at 2am when my Scheduled Plex Tasks kicked off but would continue endlessly until I stopped the docker container for plex-auto-languages.

The logs on the plex-auto-languages docker container doesn't reveal much. plexautolanguages-dozzle

These are the plex server logs https://pastebin.com/qHnLGCKp

JourneyOver commented 1 month ago

This repository is pretty much dead in terms of development or anything really, but the only way to really fix it short of going into the code and fixing things is to disable the scheduler in the config file.

You could go and try my version if you would like and see if it works for you -- https://hub.docker.com/r/journeyover/plex-auto-languages

it has updated dependencies and I fixed up a few issues.

itsANHonor commented 1 month ago

Thanks, I'll give it a shot.

itsANHonor commented 1 month ago

@JourneyOver Unfortunately your version still is creating the same issue, but it seems to be localized to one particular show. I'll try getting Plex to ignore that one show.

JourneyOver commented 1 month ago

Hmm damn, sucks that it was even is doing it with my version :/ the fix for the particuler error in the image is from this PR https://github.com/RemiRigal/Plex-Auto-Languages/pull/100 which I had pushed into my version, as I was having the same issue as you for a very long time until I implemented it myself and stopped having the issues. Mind throwing up what show exactly it seems to be localized on that is possibly causing the issue still?

itsANHonor commented 1 month ago

Interesting. Appreciate your help! I labeled the show with the ignore label and still ran into the issue last night. I'm attempting to stop the trigger_on_scan functionality for PAL to see if that helps.

Pastebin seems to be down, but I had the Plex server logs here: https://pastebin.com/qHnLGCKp

It's a show called Strikeback that it seems to be stuck on in particular.

JourneyOver commented 1 month ago

Sadly I still haven't been able to reproduce the NotImplementedError that shows in your picture ever since forking and committing PR #100 into my fork. So I'm honestly currently stuck on trying to figure out why it's still producing the error for you. The only other fix really is just straight up turning off the scheduler completely like suggested in #90 .

itsANHonor commented 1 month ago

Ah sorry to be clear, once I moved to your new image, the NotImplemented Error has gone away, but I was still getting the CPU intensive loops for that one show every night when Plex Media Server kicked off background tasks. I finally just disabled the PAL "Start on Scan" feature and it seems to have stopped that issue last night. I'm still not sure why it was so stuck on one show, but I'll keep it this way for now.

s0len commented 1 month ago

@JourneyOver please, can you make the tags available so I can use it in helm charts? God damn love PAL but it's unusable as is so I'd love to try your version

Here's an example repository: docker.io/journeyover/plex-auto-languages tag: v1.2.3

JourneyOver commented 1 month ago

@s0len to answer you both here and on #100

It's already up on github located here -- https://github.com/JourneyDocker/Plex-Auto-Languages as I have it under an org that I have all my docker stuff under.

I currently don't have it setup with any tags short of just latest right now and probably will just keep using the latest tag for now as I have no real plans on implementing features, I'm just trying to fix bugs that pop up and keep dependencies updated, but you can use either docker.io/journeyover/plex-auto-languages:latest or ghcr.io/journeydocker/plex-auto-languages:latest to use my version.

I am still trying to figure out the high cpu usage problem that people seem to be experiencing, but I have not been able to reproduce the problem myself at all, so I currently still have no fix in place for said problem, but other things like the whole raise NotImplementedError('History objects cannot be reloaded. Use source() to get the source media item.') NotImplementedError: History objects cannot be reloaded. Use source() to get the source media item. problem is fixed in my version (at least from what I can tell as I haven't seen the error myself any in my fork).