Plex crashes after a while

Server Version#: 1.13.8.5395-10d48da0d”
Android Player Version#: 7.6.2.7169 (3fbe9ee)
Samsung Smart TV Player Version#: 2.012

Hi there,

I am Plex Pass User since 28.08.2018.
Since then I have extreme problems and Plex is almost useless for me.
I start a series, whether on the Android phone (always the latest version) or Samsung TV. Sometimes it runs longer, sometimes shorter (everything between 30 seconds and 10 minutes already had) and then the playback stops and the web interface of the PMS is not reachable anymore. Only after a manual restart of the PMS I can continue the playback.

My PMS runs in a Docker container of linuxserver.io. I’ve tested quite a few PMS versions with the same problem. Currently I use the version “1.13.8.5395-10d48da0d”. I had exactly the same problems running PMS on a VM so I would say it is not a docker related problem.

Plex Media Server Logs_2018-10-08_18-33-06.zip (1.6 MB)

It would be great if somebody coud help me. If you need more informations please let me know.

Cheers
Kai

Are you using some sort of reverse proxy? I’m seeing some odd redirects in your log.

Yes, at this time I used a nginx reverse proxy but for debugging I used a direct connection with the same result.

The config I used was the following and it has been working before.

server {
    listen 443 ssl;

    server_name plex.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;
    proxy_redirect off;
    proxy_buffering off;

    # enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;


    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /login;

        include /config/nginx/proxy.conf;
        #resolver 127.0.0.11 valid=30s;
        #set $upstream_plex plex;
        proxy_pass http://docker1:32400;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
        proxy_set_header X-Plex-Device $http_x_plex_device;
        proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
        proxy_set_header X-Plex-Platform $http_x_plex_platform;
        proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
        proxy_set_header X-Plex-Product $http_x_plex_product;
        proxy_set_header X-Plex-Token $http_x_plex_token;
        proxy_set_header X-Plex-Version $http_x_plex_version;
        proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
        proxy_set_header X-Plex-Provides $http_x_plex_provides;
        proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
        proxy_set_header X-Plex-Model $http_x_plex_model;
    }
}

I’m not familiar with linux but from the log, it shows that PMS was told to shutdown by your system. Could be a OOM (out of memory) issue or some other OS level issue triggering PMS to shutdown. How much memory do you have allocated to the docker?

It could be my manual shutdown via “docker stop”. If the Plex webinterface is not reachable anymore the only way is to restart the docker container which could cause this log entry.

The docker has 4 GB RAM which should be enough.

Any other guesses or something that I can test?

I have looked at the logs and i can see what looks like a deadlock before one of your shutdowns - the shutdown at 16:31:49. Deadlocked just before 16:26:40.662 .

I would advise following the guidelines for capturing diagnostics for deadlocks - I have several forum posts on the subject. This is one Server Crashing (reproduceable)

For deadlocks, need list of connections, a process dump and debug logs - see below

Diagnostics for Deadlocks on NAS/Linux

  • Ensure debug logging remains enabled. (Settings / Server / General / Show Advanced)
  • Ensure crash reporting is enabled. (Settings / Server / General / Show Advanced)

When you get the lockout (and please wait at least 5 minutes trying to access the server, before deciding there is a deadlock), do the following

in a browser get this request to this server
http://10.10.10.11:32400/connections?X-Plex-Token=xxxxxxxxxxxxxxxxx
Substitute the server token for the xxxxxxxxxxxxxxxxxxx
See this article for how to find the token
https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
(This assumes your server remains on IP address 10.10.10.11)

Copy the response to a text file and send it to me by private message referencing this forum topic

Then get a process dump through the command line in Linux
kill -SEGV <pid>
where <pid> is the PID number for the plexmediaserver process

The crash report should get uploaded when you restart the server

Wait for few minutes and then get the logs zip and attach here. The crash uploader logs would give the information I need to locate the dump. The other logs would be needed for the investigation of the deadlock

(I did notice that one of your shutdowns was only 17 seconds after a successful request that completed ok. For deadlocks, it is important that you wait longer than that - at least 5 minutes - before deciding tit could be a deadlock

Hi @sa2000 and thank you for your investigation,

sorry for the delayed response. I had not much time. I just did what you suggested with the attached log.
Plex Media Server Logs_2018-10-30_20-46-21.zip (1.7 MB)

These deadlocks are becoming a bit ridiculous for me. I’ve had 4 in the last 24 hours.

Thanks for the dump and logs and connections list

The deadlock appears to have got triggered whilst playback to a remote XBox One - for user deemsxxxxx@xxxx.xxx
There was a lot of seeking going on and that was probably a factor as each seek results in the current transcoder job being killed and new one started and probably hitting some timing bug that leads to a lockout.

Could you check if the user streaming your media was skipping at around Oct 30, 2018 02:17 am to 02:20
The deadlock arose at around 02:19:35

I will be referring the evidence to the development team

further to my earlier post. i am seeing a lot of transcoder failures and these may be a factor.

Can you tell me if these are network drives?

T:\Transcoding
O:\Plex Media Server

They are both local drives. O:\ is a NVME drive, T:\ is a 32 GB ramdrive. I kinda forgot I had setup the ramdrive it was so long ago, I can move transcoding to the NVME drive if you think that would be worth a try for science and such.

I talked to the deems guy in question, he said he had fast forwarded through the opening credits and then it buffered for a few minutes before it gave up on his end.

Actually, after checking the history… it looks like the one common denominator between all deadlocks the last 24 hours have been an xbox one starting a transcode. In each instance the video had started up within 1-3 minutes of the deadlock.

A lot of errors like this

Oct 30, 2018 02:18:02.706 [19312] ERROR - [Transcoder] Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory
Oct 30, 2018 02:18:02.706 [19012] ERROR - [Transcoder] Error initializing output stream 0:0 --
Oct 30, 2018 02:18:02.998 [12844] DEBUG - Jobs: 'C:\Program Files (x86)\Plex\Plex Media Server\PlexTranscoder.exe' exit code for process 12800 is 1 (failure)

The codec that was being used for audio was aac_mf which is the windows Media Foundation codec Microsoft AAC Audio Encoder MFT

The codec for video h264 which should be in the plex codecs folder

Need to check the contents of the codecs directory
O:\Plex Media Server\Codecs\531e313-1328-windows-i386
could you list directory showing filenames, sizes, dates
Might need to delete the h264 one and get it re-downloaded

(No harm in moving the transcode temp directory to the SSD - to simplify the setup and eliminate any ram drive issues)

Ok, changed transcoding folder to O:\Transcoding

List of files in codec folder:


Name                   CreationTime            Length
----                   ------------            ------
aac_decoder.dll        10/9/2018 4:16:26 PM    683022
ac3_decoder.dll        10/9/2018 4:16:27 PM    414222
ac3_encoder.dll        10/9/2018 4:16:28 PM    473614
dca_decoder.dll        10/9/2018 4:16:28 PM    686094
h264_decoder.dll       10/9/2018 4:16:29 PM   1563150
hevc_decoder.dll       10/9/2018 4:16:30 PM    881166
libmp3lame_encoder.dll 10/9/2018 4:16:31 PM    542222
libx264_encoder.dll    10/9/2018 4:16:31 PM   1518606
mp2_decoder.dll        10/9/2018 4:16:32 PM    661006
mp3_decoder.dll        10/9/2018 4:16:33 PM    661006
mpeg1video_decoder.dll 10/9/2018 4:16:34 PM    610830
mpeg2video_decoder.dll 10/9/2018 4:16:35 PM    624654
mpeg4_decoder.dll      10/9/2018 4:16:36 PM   1292814
vc1_decoder.dll        10/9/2018 4:16:36 PM   2120718

Also having a similar issue, server is running on Windows.

PMS shows active & live in System Tray. When logging into the Web GUI, it sits & attempts to locate my server but fails to do so.

I exit PMS from system tray & force it closed via Task Manager. I sent you a private message as I wasn’t sure what I should do.

I saw in another post you suggested to obtain a Dump File when it crashes which I did.

Let me know how to proceed!

Thanks

file sizes look ok

It could be the ram drive. I have discussed with the development team and the error
[Transcoder] Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory is a filesystem i/o error

Have a look at the logs now and see that the new path is being referenced and if there are still these errors.

Still throwing the same error, checked and it was using the new directory for transcoding.

Oct 31, 2018 07:02:11.372 [5584] ERROR - [Transcoder] Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory
Oct 31, 2018 07:02:11.372 [12240] ERROR - [Transcoder] Error initializing output stream 0:0 –

Server hasn’t deadlocked again, but the 4 deadlocks in 24 hours was most unusual in the first place. I was generally getting them once every 2~ days or so.

Are you familiar with procmon.exe ? Process Monitor - Sysinternals | Microsoft Learn
We can use that to see what path the transcoder was trying to write to

(if you can easily get that error, then start procmon.exe to capture all events, when you know the error was logged, stop the capture, save all to PML file. Zip the file and upload the zip on dropbox or similar service and send me link to it by private message and the plex media server log file with the error and i will check it

(Was Plex Media Server relaunched after the path change to the SSD drive?)

Yeah, I’ll try and capture the error with procmon for you. I did relaunch Plex after changing the path for the transcoding directory.