PLEX movie issue - CPU death spiral

ALL: I don’t have/do windows. Please keep that in mind.

@freezegunn47

Apr 18, 2023 08:18:08.101 [7188] WARN - [Req#2a06/Transcode/o925pbu6cr8ffjh5ct5i7a02/4c9d3ee3-3e9f-483d-8c47-0cab89a11042] Low disk space: 0B source file, 3.99GB capacity, 82.39MB available on “R:\PLEX-TRANSCODE-TMP\Transcode\Sessions\plex-transcode-o925pbu6cr8ffjh5ct5i7a02-4c9d3ee3-3e9f-483d-8c47-0cab89a11042”

No space left
If “R” is a network mount – that’s not safe either.

FWIW Only the original poster is using Windows. I’m using Ubuntu + Docker, Esilberberg is running unRaid + docker and jseeley is running MacOS I believe. I don’t think this issue is OS dependent.

I attempted using the default movie agent for my libraries and disabled any external 3rd party tools like PlexMetaManager for collections and overlays and the same issue started happening after about 2 weeks again.

May I have the Server logs ZIP file please (DEBUG logging ON) which captures this?

I can’t diagnose snippets.

(what looks like the problem is often not where the problem began)

Did you make any progress with the database files I sent you?

I’ll work on complete a complete set of logs

I made progress but have no resolution yet.
I got pulled onto the transcoding drivers update work. (my work hours are limited each week)

as long as you were able to replicate the issue and you have what you need from the people in the thread. (I’m a software dev, I get it)

1 Like

Thanks,

Cat in a room full of rocking chairs

:scream_cat:

Checking in if there is any progress on this. My server has been hitting this issue fairly often the last few days. I can’t tell what media someone is attempting to play, so they keep trying and bringing the server down. :sob:

still experiencing the issue… anyone else?

I’ve exchanged a few messages with Chuck and am currently testing a non-docker local install that has been working for the last 2 weeks.

I have some suspicions it might be the labels PMM adds when using overlays, or possibly having too many collections. (Though I though I tested this previously)

I’d hate to not be able to run overlays and collections so I’m still hopeful there’s a fix that can be implemented. Perhaps not loading “includeRelated=0” on playback start would work, but I’m not a dev and am not aware of any side effects that might happen.

I don’t have many collections, but I do have a few now. I’m pretty sure this was happening previous to having collections though.

What are overlays?

I’ve been trying to do a refresh metadata in bulk (just to the new titles) whenever I add new movies, but I don’t always remember.

FYI not sure how much docker has to do with anything. My instance is installed on Windows 10 and has the same issue.

I’m not sure what overlays are. I have 202 Collections, and turned off the function that adds them automatically a while ago. I only kept my custom ones and the ones that made sense because the movies don’t all have the same name (like the Conjuring franchise). I can’t imagine 200 Collections is “too many” for Plex to handle. That would be absurd. I also don’t think this has anything to do with the size of individual Collections, because it doesn’t occur on movies in my largest Collections, but one of my smallest collections (3 movies) spikes the CPU above 20% just opening it, and looking at any one of the movies does the same (and the related content never loads - it clearly times out).

Honestly the thing that seems most likely to cause it - though it’s not always the case - is having movies with multiple versions. My Star Wars movies seem to be the most likely to cause the issue, and I have more versions of each Star Wars movie than anything else in my collection.

only 20% :rofl:

This is what its like for me when someone is trying to play an affected movie, sometimes it can recover, but usually results in an unresponsive server and I have to manually restart.

I have a Ryzen 9 3900X in my server. A 20% spike just to view a collection - not even opening the XML for a movie yet, and not even trying to play it - is very significant.

Since it doesn’t seem like this will be addressed anytime soon, I added upon a local “plex-keep-alive” script that I’ve been using for a while. Previously it would just wake up every 15 seconds and check if the plex service was running, and if not, start it up, this would catch cases of crashes. NOW it will also call the plex api and see if it gets a 200 response, and if not, then it will quit/kill the service (which should then re-launch at the next run of the script when it finds it not running)

I’ve never actually used the plex api for anything, but I’m calling “http://127.0.0.1:32400/status/sessions” I’m unsure if this endpoint will actually become un-responsive when the service does. If anyone has a better idea let me know. ¯\_(ツ)_/¯

I’ll report back if it’s successful or not.

1 Like

Since reverting to the Legacy movie agent, I haven’t had the issue. I’d love to go back to the new Plex Movie Agent though, so if the monitoring script idea works for you, I’ll probably follow suit as well

IS there any way you can share that script? I’m running PMS on a Windows system as well. That’s all it does 98% of the time and these 98% CPU hits for 10-15 minutes end up stopping all Plex functions and I have to stop Plex (Server Service App) and restart it because it’s still running, but not functioning.

I’ve been running the legacy movie agent as well. I tried moving back to the new agent last weekend and things started breaking within 24 hours.

I don’t think a monitoring script will do much except for mask the issue, and if someone is continually trying to play a broken movie the server is just going to stay unresponsive.

@ChuckPa I’m curious if you’ve heard anything? Last we chatted I had installed a completely local server with no 3rd party tools and it also started experiecing the same issue within a week.

I’m running on macOS and the script was done in applescript, but it could probably be adapted to powershell or a batch file.

The script had a crash last night, so I’ll need to look into that though… :neutral_face:

these are the basics of it though

property plexToken : "YOUR_TOKEN_HERE" 
on idle
	tell application "System Events"
		set running_apps to every application process's name
		if running_apps does not contain "Plex Media Server" then
			display notification "Restarting PMS - Not Found" with title "Plex Script"
			tell application "Plex Media Server" to activate
		end if
		-- Check Plex API for status, but only if plexToken is not empty
		if plexToken is not "" then
			set plexResponse to do shell script "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:32400/status/sessions?X-Plex-Token=" & plexToken
			if plexResponse is not "200" then
				-- Try a normal quit first
				display notification "Quiting PMS - Plex API status code: " & plexResponse with title "Plex Script"
				tell application "Plex Media Server" to quit
				-- Wait for a bit (10 seconds)
				delay 10
				-- Check if it's still running, if so, force quit
				tell application "System Events"
					if exists (every process whose name is "Plex Media Server") then
						set plexProcesses to every process whose name is "Plex Media Server"
						repeat with plexProcess in plexProcesses
							display notification "Force Quit PMS - non200 API" with title "Plex Script"
							do shell script "kill -9 " & (unix id of plexProcess)
						end repeat
					end if
				end tell
			end if
		end if
	end tell
	return 15
end idle

my guess is the curl timed out and returned a non-zero exit code and i’ll need to wrap that in a “try” to catch the error

1 Like