Ubuntu 18.04: Plex Media Server Consistently Crashing

Hi All,

AS of this evening, Plex Media Server started crashing on me. When I restart the service, it crashes again within 3 minutes. Here is what systemctl shows me under status:

root@LX-MediaServer01:/home/administrator/Downloads# systemctl status plexmediaserver
● plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-08-10 01:17:40 MDT; 10min ago
Main PID: 2481 (sh)
Tasks: 146 (limit: 4915)
CGroup: /system.slice/plexmediaserver.service
├─2481 /bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver “/usr/lib/plexmediaserver/Plex Media Server”
├─2482 /usr/lib/plexmediaserver/Plex Media Server
├─2602 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.13.5.5291-6fa5e50a8 /usr/lib/plexmediaserver/
├─2689 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.13.5.5291-6fa5e50a8 32600 /waitmutex
├─3766 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.13.5.5291-6fa5e50a8 /usr/lib/plexmediase
├─3801 /usr/lib/plexmediaserver/Plex Relay -p 443 -N -R 0:localhost:32401 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/relayHostKey.txt -o None
├─4109 Plex Plug-in [com.plexapp.agents.thetvdb] /usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.13.5.5291-6fa5e50a8 /usr/lib/plexmedi
├─4151 Plex Plug-in [com.plexapp.agents.localmedia] /usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.13.5.5291-6fa5e50a8 /usr/lib/plexm
└─4276 /usr/lib/plexmediaserver/Plex Media Scanner --scan --refresh --section 9

Aug 10 01:17:40 LX-MediaServer01 systemd[1]: Starting Plex Media Server for Linux…
Aug 10 01:17:40 LX-MediaServer01 systemd[1]: Started Plex Media Server for Linux.
Aug 10 01:19:56 LX-MediaServer01 sh[2481]: connect: Connection timed out
Aug 10 01:22:07 LX-MediaServer01 sh[2481]: connect: Connection timed out
Aug 10 01:24:35 LX-MediaServer01 sh[2481]: connect: Connection timed out
Aug 10 01:26:46 LX-MediaServer01 sh[2481]: connect: Connection timed out

I wiped out the machine and restored from backup, same issue. I purged and re-installed Plex using the latest .deb package, same issue.

Grasping at straws here… anyone else having issues?

Thanks

Just to note, I can get to the server (even with the error) and stream to other devices. Android OS, iOS, Nvidia Shield TV and Xbox One all fail to stream. HOWEVER - if I cast from the my computer to the Xbox or Shield TV, it works…

Please recreate the problem (crashing)

Then

Create a ZIP or TAR.GZ of /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs and attach it. I’ll see what’s happening

Hey Chuck,

Here is the latest Systemctl Status:

root@LX-MediaServer01:~# systemctl status plexmediaserver
● plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-08-10 10:51:48 MDT; 3min 0s ago
Process: 10324 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” (code=exited, status=0/SUCCESS)
Main PID: 10327 (sh)
Tasks: 58 (limit: 4915)
CGroup: /system.slice/plexmediaserver.service
├─10327 /bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver “/usr/lib/plexmediaserver/Plex Media Server”
├─10330 /usr/lib/plexmediaserver/Plex Media Server
├─10360 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.13.5.5291-6fa5e50a8 /usr/lib/plexmediaserver
├─10410 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.13.5.5291-6fa5e50a8 32600 /waitmutex
└─10436 Plex Plug-in [com.plexapp.agents.opensubtitles] /usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.13.5.5291-6fa5e50a8 /usr/lib/p

Aug 10 10:51:48 LX-MediaServer01 systemd[1]: Starting Plex Media Server for Linux…
Aug 10 10:51:48 LX-MediaServer01 systemd[1]: Started Plex Media Server for Linux.
Aug 10 10:54:05 LX-MediaServer01 sh[10327]: connect: Connection timed out

Logs are:

Logs.zip (2.6 MB)

Let me know if you need anything more!

Erik,
Are you certain these are the correct logs?

Your oldest log file shows:

Aug 10, 2018 05:45:54.154 [0x7f0532120700] INFO - Plex Media Server v1.13.5.5291-6fa5e50a8 - ubuntu PC x86_64

That operating session was terminated on command. It did not crash.

Aug 10, 2018 10:51:11.980 [0x7f05293ff700] DEBUG - Request: [127.0.0.1:48320 (Loopback)] GET /myplex/account (13 live) GZIP Signed-in Token (erik.zeitz)
Aug 10, 2018 10:51:11.981 [0x7f0522bfb700] DEBUG - Request: [172.25.11.49:65110 (Subnet)] GET /myplex/account (13 live) TLS GZIP Signed-in Token (erik.zeitz)
Aug 10, 2018 10:51:11.982 [0x7f052fbff700] DEBUG - Auth: authenticated user 1 as erik.zeitz
Aug 10, 2018 10:51:11.982 [0x7f052f3fe700] DEBUG - Completed: [127.0.0.1:48320] 200 GET /myplex/account (13 live) GZIP 1ms 1675 bytes (pipelined: 2)
Aug 10, 2018 10:51:11.982 [0x7f0511ffd700] DEBUG - Request: [127.0.0.1:48322 (Loopback)] GET /myplex/account (13 live) GZIP Signed-in Token (erik.zeitz)
Aug 10, 2018 10:51:11.983 [0x7f052fbff700] DEBUG - Completed: [172.25.11.49:65110] 200 GET /myplex/account (13 live) TLS GZIP 2ms 1675 bytes (pipelined: 2)
Aug 10, 2018 10:51:11.983 [0x7f052fbff700] DEBUG - Completed: [127.0.0.1:48322] 200 GET /myplex/account (13 live) GZIP 1ms 1602 bytes (pipelined: 2)
Aug 10, 2018 10:51:48.281 [0x7f053e2d7840] DEBUG - Shutting down with signal 15
Aug 10, 2018 10:51:48.282 [0x7f053e2d7840] DEBUG - Ordered to stop server.
Aug 10, 2018 10:51:48.282 [0x7f053e2d7840] WARN - Timed out waiting for server to finish.
Aug 10, 2018 10:51:48.282 [0x7f053e2d7840] DEBUG - Stopping server...
Aug 10, 2018 10:51:48.282 [0x7f053e2d7840] DEBUG - HttpServer: Stopping server.
Aug 10, 2018 10:51:48.282 [0x7f053e2d7840] DEBUG - Server is already in shutdown mode, ignoring this signal...
Aug 10, 2018 10:51:48.282 [0x7f05143fd700] DEBUG - MetadataItemClusterRequestHandler: a shutdown event has been received
Aug 10, 2018 10:51:48.282 [0x7f05143fd700] DEBUG - TranscodeJobManager: [Running] onServerShutdown
Aug 10, 2018 10:51:48.282 [0x7f05143fd700] DEBUG - TranscodeJobManager: [Running] -> [Shutdown]
Aug 10, 2018 10:51:48.284 [0x7f053e2d7840] DEBUG - Server stopped.
Aug 10, 2018 10:51:48.284 [0x7f053e2d7840] DEBUG - NetworkService: Stopping advertisement.
Aug 10, 2018 10:51:48.284 [0x7f053e2d7840] DEBUG - Killing plug-ins.
Aug 10, 2018 10:51:48.284 [0x7f053e2d7840] DEBUG - [com.plexapp.system] Killing.
Aug 10, 2018 10:51:48.284 [0x7f0518fff700] ERROR - Network Service: Error in advertiser handle read: 125 (Operation canceled) socket=72
Aug 10, 2018 10:51:48.284 [0x7f053e2d7840] DEBUG - Waiting for Plex Tuner Service to exit.
Aug 10, 2018 10:51:48.384 [0x7f0518fff700] INFO - Network Service: Abandoning advertise socket, it was closed.
Aug 10, 2018 10:51:48.435 [0x7f051efff700] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Tuner Service' exit code for process 2689 is 0 (success)
Aug 10, 2018 10:51:48.435 [0x7f0514bfe700] DEBUG - Plex Tuner Service exited.
Aug 10, 2018 10:51:48.445 [0x7f053e2d7840] DEBUG - Killing job.
Aug 10, 2018 10:51:48.445 [0x7f053e2d7840] DEBUG - Signalling job ID 9904 with 9
Aug 10, 2018 10:51:48.445 [0x7f053e2d7840] DEBUG - Database: Shutting down.
Aug 10, 2018 10:51:48.445 [0x7f053e2d7840] DEBUG - Captured session 0.

This shows 5 hours of operation with normal, commanded, stop.

Hey Chuck,

Is there a different place the logs would be stored?

Can I delete the logs folder and restart plex to generate new logs? Is there a safe way to do this?

If you look at the service, it shows:

Aug 10 10:54:05 LX-MediaServer01 sh[10327]: connect: Connection timed out

I keep getting this over and over. While it may be normal, I haven’t seen that happening before so I’m not sure what’s happening there. I’ve restarted the machine with no SSH into it and keep getting the time out. I re-installed Plex in it’s entirety last night and saw this before and after the installation.

Thanks!

Don’t delete the Logs directory, because that happens during first-run initialization, but you can safely sudo rm -rf Logs/* if it’s stopped.
The agents will create what they need as needed.

Hey Chuck,

I stopped PMS, then ran the command, started it again and let the service run for 15 minutes. The below logs are the result of that 15 minute run:

Logs.zip (84.4 KB)

Here is what Systemctl status showed at the end of the 15 minute run:

● plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-08-10 12:12:34 MDT; 15min ago
Process: 11440 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” (code=exited, status=0/SUCCESS)
Main PID: 11442 (sh)
Tasks: 61 (limit: 4915)
CGroup: /system.slice/plexmediaserver.service
├─11442 /bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver “/usr/lib/plexmediaserver/Plex Media Server”
├─11443 /usr/lib/plexmediaserver/Plex Media Server
├─11471 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.13.5.5291-6fa5e50a8 /usr/lib/plexmediaserver
├─11520 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.13.5.5291-6fa5e50a8 32600 /waitmutex
└─11666 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.13.5.5291-6fa5e50a8 /usr/lib/plexmedias

Aug 10 12:12:34 LX-MediaServer01 systemd[1]: Starting Plex Media Server for Linux…
Aug 10 12:12:34 LX-MediaServer01 systemd[1]: Started Plex Media Server for Linux.
Aug 10 12:14:49 LX-MediaServer01 sh[11442]: connect: Connection timed out
Aug 10 12:17:00 LX-MediaServer01 sh[11442]: connect: Connection timed out
Aug 10 12:19:11 LX-MediaServer01 sh[11442]: connect: Connection timed out
Aug 10 12:21:24 LX-MediaServer01 sh[11442]: connect: Connection timed out
Aug 10 12:23:35 LX-MediaServer01 sh[11442]: connect: Connection timed out
Aug 10 12:24:13 LX-MediaServer01 sh[11442]: Connection to 184.105.148.104 closed by remote host.
Aug 10 12:24:37 LX-MediaServer01 sh[11442]: Connection to 184.105.148.106 closed by remote host.
Aug 10 12:25:46 LX-MediaServer01 sh[11442]: connect: Connection timed out

Please let me know if that gives you any indication of the issue or if there is something else I can do on my end.

Thanks!

Now I see it. Thank you.

Plex Relay is running (no direct connection) to the player. The CERT handshake is incomplete on the other end and it falls out completely.

Aug 10, 2018 12:19:13.205 [0x7f9c0f3ff700] DEBUG - EventSource: Resolving 1xx.xx.xxx.97 port 443s
Aug 10, 2018 12:19:13.206 [0x7f9c0f3ff700] DEBUG - EventSource: Failure in ReadData (9 - Bad file descriptor).
Aug 10, 2018 12:19:13.206 [0x7f9c0f3ff700] ERROR - EventSource: Retrying in 30 seconds.

Relay is starting because remote access isn’t connected.

Whichever player is trying to access from that xxx.97 IP isn’t giveing you a valid cert. HTTPS can’t be established and this is causing it to fail.

What you’re seeing in the log is Relay continuing to try , because the client player is trying, and eventually failing completely "Connection Timeout "

Root cause: No direct access (Remote Access) available.

How would you like to proceed?

Hey Chuck,

Is there a way for me to identify the client causing this and stop it from connecting? The only IP I have ending in 97 is statically assigned to an iDrac. So I feel like that IP is someone external.

Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.