Plex crashes randomly after latest update

Its funny because I had only recently turned off debug logging, that’s my bad! I did run an optimize yesterday to see if itd help, as I also noticed the slow queries. I would say that the server hasnt been particularly loaded in recent times, and certainly not when I’ve had the issue the most.

I’ve switched it back on and will follow up if I see it again (likely in my own post), it seems to take a few days to manifest.

Server just crashed. Logs incoming, debugging is NOT turned on. It will be from now until this is resolved.plexlogs.zip (6.3 MB)

Second round of logs because now it’s just being extremely sluggish, I’ve done nothing since updating this morning.
Plex Media Server Logs_2021-03-26_17-41-19.zip (4.7 MB)

I’m having similar issues. Now the optimize DB selection gives me this too: [Database optimization/com.plexapp.plugins.library.db] SQLITE3:(nil), 17, statement aborts at 57: [select * from metadata_items limit 1] database schema has changed

@rafisher79

Immediately following an optimize, the database will always show as schema changed.

This is because of the state of the index tables which get squashed out during optimiztion. It’s possible they’ve not adjusted it to account for the latest additions (suppress the warnings)… I’ll investigate and file .

It’s harmless otherwise.

@kazz3r24

Thanks for the logs.

I see a few things.

Biggest I see is the slow database. The upgrade to 1.21.1.4288 did fragment it.
You should consider optimizing it. This will make it sluggish.
On your machine, 50 items should be 1-2-3 milliseconds worst case.

Mar 26, 2021 17:35:53.506 [0x7f11af7fe700] WARN - Sync: sync list 45373996 belonging to user 24805200 (SonicRising) has died of old age, ignoring
Mar 26, 2021 17:35:53.521 [0x7f11af7fe700] INFO - Sync: downloaded 9 sync list(s) with 48 sync items(s): 0 new, 0 updated, 0 deleted
Mar 26, 2021 17:35:53.688 [0x7f10f2ffd700] WARN - SLOW QUERY: It took 420.000000 ms to retrieve 50 items.
Mar 26, 2021 17:35:53.803 [0x7f1180ff9700] WARN - SLOW QUERY: It took 280.000000 ms to retrieve 50 items.
Mar 26, 2021 17:35:54.444 [0x7f11b51cf700] INFO - [CERT/OCSP] Successfully retrieved response from cache.
Mar 26, 2021 17:35:54.451 [0x7f11b51cf700] INFO - [CERT/OCSP] Successfully retrieved response from cache.
Mar 26, 2021 17:35:54.527 [0x7f11b49ce700] WARN - MyPlex: attempted a reachability check but we're not yet mapped.
Mar 26, 2021 17:35:55.052 [0x7f10f37fe700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 26, 2021 17:35:56.061 [0x7f10f3fff700] INFO - AutoUpdate: no updates available
Mar 26, 2021 17:35:56.499 [0x7f115bfff700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Scaled up video bitrate to 15660Kbps based on 4.500000x fudge factor.
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Streaming Resource: Reducing playback quality for 1904kbps stream bitrate: video resolution to 720x300, audio channels to 2, quality to 68
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Scaled up video bitrate to 15660Kbps based on 4.500000x fudge factor.
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Scaled maximum bitrate for resolution reduction to 2202Kbps.
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: Selected protocol dash; container: mp4
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: analyzing media item 1442331
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: Captain Marvel (2019): Direct Play is disabled
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: Captain Marvel (2019): media must be transcoded in order to use the dash protocol
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: Captain Marvel (2019): no direct play video profile exists for http/mkv/hevc
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: Captain Marvel (2019): no direct play video profile exists for http/mkv/hevc/ac3
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Captain Marvel - video.bitDepth limitation applies: 10 > 8
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Captain Marvel - audio.channels limitation applies: 6 > 2
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: Captain Marvel (2019): no remuxable profile found, so video stream will be transcoded
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: Cannot direct stream video stream due to profile or setting limitations
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Scaled up video bitrate to 15660Kbps based on 4.500000x fudge factor.
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Scaled maximum bitrate for resolution reduction to 2202Kbps.
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Captain Marvel - audio.channels limitation applies: 6 > 2
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: Cannot direct stream audio stream due to profile or setting limitations
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] MDE: Captain Marvel (2019): selected media 0 / 1442331
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Streaming Resource: Adding session 0x7f1128015990:dcfviblxabfc3qrxedrpzp9o which is using 1988kbps of WAN bandwidth.  Used is now 6865kbps
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Streaming Resource: Adding session 0x7f1128015990:dcfviblxabfc3qrxedrpzp9o which is using transcoder slot.  Used slots is now 1
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Streaming Resource: Added session 0x7f1128015990:dcfviblxabfc3qrxedrpzp9o
Mar 26, 2021 17:36:11.651 [0x7f115affd700] DEBUG - [Transcode] Streaming Resource: Reached Decision id=534439 codes=(General=1001,Direct play not availab

FFMPEG:

Mar 26, 2021 17:36:11.905 [0x7f1113fff700] DEBUG - [Transcode] Cleaning directory for session d9dn0evgnutjcftwi3si5pkx ()
Mar 26, 2021 17:36:11.906 [0x7f1113fff700] DEBUG - [Transcode] Starting a transcode session d9dn0evgnutjcftwi3si5pkx at offset -1.0 (state=3)
Mar 26, 2021 17:36:11.906 [0x7f1113fff700] DEBUG - [Transcode] [Universal] Using local file path instead of URL: /mnt/Echo/Movies/Captain Marvel (2019)/Captain Marvel (2019)-Bluray-1080p.mkv
Mar 26, 2021 17:36:11.906 [0x7f1113fff700] DEBUG - [Transcode/JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/73e06c8-3759-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxL' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'hevc' '-codec:1' 'ac3' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/mnt/Echo/Movies/Captain Marvel (2019)/Captain Marvel (2019)-Bluray-1080p.mkv' '-filter_complex' '[0:0]scale=w=720:h=300[0];[0]format=pix_fmts=yuv420p|nv12[1]' '-map' '[1]' '-codec:0' 'libx264' '-crf:0' '19' '-maxrate:0' '1687k' '-bufsize:0' '3374k' '-r:0' '23.975999999999999' '-preset:0' 'veryfast' '-x264opts:0' 'subme=6:me_range=4:rc_lookahead=10:me=hex:8x8dct=1' '-force_key_frames:0' 'expr:gte(t,n_forced*8)' '-filter_complex' '[0:1] aresample=async=1:ocl='\''stereo'\'':rematrix_maxval=0.000000dB:osr=48000[2]' '-map' '[2]' '-metadata:s:1' 'language=eng' '-codec:1' 'aac' '-b:1' '206k' '-f' 'dash' '-seg_duration' '8' '-init_seg_name' 'init-stream$RepresentationID$.m4s' '-media_seg_name' 'chunk-stream$RepresentationID$-$Number%05d$.m4s' '-window_size' '5' '-delete_removed' 'false' '-skip_to_segment' '1' '-time_delta' '0.0625' '-manifest_name' 'http://127.0.0.1:32400/video/:/transcode/session/d9dn0evgnutjcftwi3si5pkx/6834012b-32a9-46a7-933a-4823fa314a05/manifest?X-Plex-Http-Pipeline=infinite' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'dash' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-y' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/d9dn0evgnutjcftwi3si5pkx/6834012b-32a9-46a7-933a-4823fa314a05/progress'
Mar 26, 2021 17:36:11.907 [0x7f1113fff700] DEBUG - [Transcode/JobRunner] Jobs: Starting child process with pid 27141

CPU: Has no QSV listed but has 14,000 passmarks so it really doesn’t care :smiley:

Thank you for the analysis of the logs, this will help me to better learn how to understand what I’m seeing as well. I will definitely be optimizing the database to correct the issue.

For the transcoding snippets you’ve pointed out, is there an issue there?

It’s only an issue if you had stuttering with the playback.

Those video bitrates are so low that with 14000 passmarks, Software decode and software tone mapping should still have been perfectly smooth.

Were they?

Ah, that I unfortunately can’t easily confirm - it wasn’t my stream. It looks like it was based off client settings/capabilities though, so I don’t think it’s a concern.

I did optimize the database, we’ll see how things go from here. Debugging is still on, so I’ll catch it if it does have a hiccup fingers crossed.

Ok, this time it crashed with debugging on - so hopefully we’ll be able to get an indicator as to what is causing this.

plexlogs-2021-03-27.zip (6.6 MB)

The server either restarted itself or was just unresponsive. I’ve attached logs from the moment the web UI came back up.

The web UI has become very sluggish and nearly unresponsive again. For whatever reason, I am unable to get into the actual settings to try to grab more logs.

plexlogs-2021-03-27-postrestart.zip (6.8 MB)

I’ve been fighting with my server all weekend… not fun. I’m at a complete loss for what’s been wreaking havoc on my system. At this point I’ve rebooted my servers and went back to an older kernel, the only thing preventing me from going back to the older version of Plex is the database, I don’t want flip flopping to cause more damage that it potentially already has.

I even checked for malware/viruses or if I’d somehow been hacked and was being used as a botnet zombie.

Optimizing the database also now makes the entire server seem unreachable for the duration of the optimization - that’s never been the case before.

I am also seeing Plex Server randomly crashing over the past few days, although I’m not sure it relates to latest update. My issues seem to have started with the new homepage customisation, I had a notification about the change and whether I wanted to switch right away, ever since then it has been unstable. I have some log files I can share, would you just want the Plex Server logs or others? I have been trying to replicate whatever it is causing it to crash without success…

Am running on Windows 10 Version 1.22.1.4228

You should be able to just download the logs from the troubleshooting screen, I’d just give them all of them lol.

I’m 98% convinced there’s something funny going on with this version.

@kazz3r24

Thanks for those logs.

What I’m seeing in them, unfortunately, is a full scan of your entire library.
All previous activity was pushed off the end of the buffer.

Would you consider going to Settings- Server - Library and enable “Partial Scan” ?

That way, when it fails again, the scanner starting up won’t wipe out all the data before you get to it.

I’ve also been having this problem since the beginning of last week. Running on Ubuntu 18.04. Checking the service systemctl status plexmediaserver shows the service running, and the log in that output just shows a bunch of lines with something about a decoder. Seems to happen once a day or so. I’ve been fixing it by just restarting the VM however it hangs for a few minutes during the reboot waiting for the plexmediaserver.service to end before timing out, killing the service, and continuing with the restart. The WebUI is unresponsive when this occurs as well and any clients attempting to connect just spin until they timeout and eventually all that shows are the Plex Movies & TV library, none of my libraries. Next time it happens I will try to pull the logs after rebooting.

Sure thing, I can do that @ChuckPa.

I did already have partial scan checked, but I have unchecked the other library scan options (I had them all checked). My library scans every 15min, so I’ve disabled the periodic scanning and the full scan - so it’ll just do partial scans when changes are detected for now.

On macOS Catalina here. Plex been doing the same thing. Crashing/Quitting randomly 2-3 time a day. Just happened, so I have attached the logs. I hope that helps.

Plex Media Server Logs_2021-03-29_19-21-34.zip (4.9 MB)

1 Like

TO ALL:

This is a known issue which was fixed earlier today.

Engineering is going to include the fix in PMS 1.22.2 - which is on it’s way to PlexPass beta.

3 Likes

Great news, what was the root cause out of interest?