Server Version#: 1.29.0.6244
Running in docker on debian server.
Lately, I’ve been experiencing an extremely unstable plex server with plex crashing several times a day - and docker is left in unhealthy state when I check.
Stopping and restarting the docker fixes it for a few hours.
Tutualli runs in a seperate docker - but this docker is unaffected.
I’ve provided logs saved shortly after docker was restarted.
Debug logging enabled - verbose logging disabled.
Worth to mention: I am doing a raid rebuild currently, it MIGHT be related, but I’d want someone to take a look at the logs to see if there’s another reason.
Doesn’t look so much like the server is crashing but it’s told to shutdown.
Could be some external trigger or maybe some restriction of your container (e.g. running out of RAM?).
Oct 09, 2022 01:12:59.210 [0x7fd664d3cb38] DEBUG - Shutting down with signal 15 (Terminated)
Oct 09, 2022 01:12:59.210 [0x7fd664d3cb38] DEBUG - Ordered to stop server.
Oct 09, 2022 01:12:59.210 [0x7fd66886b6f0] DEBUG - Stopping server...
Oct 09, 2022 01:12:59.210 [0x7fd66886b6f0] DEBUG - HttpServer: Stopping server.
Oct 09, 2022 01:13:00.210 [0x7fd66886b6f0] WARN - Timed out waiting for server to finish.
Oct 09, 2022 01:13:00.210 [0x7fd66886b6f0] DEBUG - Server stopped.
Oct 09, 2022 01:13:00.210 [0x7fd66886b6f0] DEBUG - NetworkService: Stopping advertisement.
Oct 09, 2022 01:13:00.210 [0x7fd66886b6f0] DEBUG - Killing plug-ins.
I ended up just writing a script that checks syslog for crashes every 5 minutes, and if crash is present in the log, it restarts the docker.
This is a poor fix, since it doesn’t really fix anything but minimizing downtime.
If anyone can tell me a way to implement a output of logs from docker in a script, I could add that as well. It seems quite random what time the server crashes, so I’m guessing there is something that triggers it.
Traditionally, these sorts of bugs has been introduced with a new version of plex, and then they dont care about it for a couple of months. If there’s no response within the next couple of days, I guess the solution will be to downgrade a couple of months back.
I also added a logging function for when the script restarts the container;
cat plex.crashlog.log
ERROR in plex - Mon 10 Oct 2022 03:30:01 PM CEST
ERROR in plex - Mon 10 Oct 2022 03:35:01 PM CEST
ERROR in plex - Mon 10 Oct 2022 07:10:02 PM CEST
ERROR in plex - Mon 10 Oct 2022 07:15:01 PM CEST
ERROR in plex - Mon 10 Oct 2022 07:40:01 PM CEST
ERROR in plex - Mon 10 Oct 2022 07:45:01 PM CEST
ERROR in plex - Mon 10 Oct 2022 08:00:02 PM CEST
ERROR in plex - Mon 10 Oct 2022 09:05:01 PM CEST
The messages within 5 minutes of eachother is my fault, as the script ran every 5 minutes, and checked the last 5 minutes of the log - thus restarting the docker twice in a row.
The script now runs in crontab every 6 minutes instead.
However, it seems plex can be stopped within the docker container;
Login to the docker container docker exec -it {plexcontainername} /bin/bash
There’s a bash file in the root dir, plex_service.shthat is a short wrapper for the -s6-svc commands for plex. So to bring the service down: ./plex_service.sh -d-u for up, or -r for restart.
cat plex_service.sh
#!/bin/bash
if [ “$#” -eq 1 ]; then
s6-svc “$1” /var/run/s6/services/plex
else
echo “No argument supplied; must be -u, -d, or -r.”
fi
The data dir for plex is also available outside the container, as it resides on its own drive, and is only mounted to the docker.
Fixed the database about 9 hours ago. It’s already crashed once again while I was away. Current uptime for docker is 4 hours.
Is there a way to automate pulling logs when I restart the docker? (Its done by a script)
Alternatively how do I “properly” downgrade.
I’m currently running the docker with plexinc/pms-docker:plexpass
This has automatically updated to latest version upon restart of the container.
Will i retain plexpass priveleges if I put a specific version number without the plexpass toggle there?