Plex server randomly becomes unresponsive

Server Version#: v1.40.5.8921
Player Version#: Android Players & Web

I recently migrated to docker from a TrueNAS plugin and this issue was occurring previously. Every now and then it seems like the server is unresponsive. I can’t load anything, can’t connect at all, sometimes when I’m watching a show it happens between playing episodes. If I wait long enough it just comes back. I’m not sure if the below logs are relevant. If I need to provide something else just let me know…

When I migrated I did a complete refresh of all my libraries as the paths changed, I optimised the database as well.

I posted some extra logs from this morning after using the PlexDBRepair tool on auto. As it suggested, I then scanned my 3 media libraries and I got those extra error messages in the logs.

Logs:
==> Plex Media Server.log <==

Aug 30, 2024 19:09:44.540 [135625621646136] ERROR - [Req#2da4] HTTP 408 downloading url http://127.0.0.1:32400/library/metadata/53735?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&includeBandwidths=1&offset=-1&X-Plex-Incomplete-Segments=1&X-Plex-Session-Identifier=aa20cdf8406d3c6c-com-plexapp-android
Aug 30, 2024 19:09:44.540 [135625814584120] ERROR - [Req#2da4] TranscodeUniversalRequest: unable to get container: /library/metadata/53735?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&includeBandwidths=1&offset=-1&X-Plex-Incomplete-Segments=1&X-Plex-Session-Identifier=aa20cdf8406d3c6c-com-plexapp-android
Aug 30, 2024 19:09:44.540 [135625814584120] WARN - [Req#2da4] Failed to obtain a streaming resource for direct play of part 136951
Aug 30, 2024 19:10:04.544 [135625609063224] ERROR - [Req#2d95] HTTP 408 downloading url http://127.0.0.1:32400/library/metadata/53735?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&includeBandwidths=1&offset=-1&X-Plex-Incomplete-Segments=1&X-Plex-Session-Identifier=aa20cdf8406d3c6c-com-plexapp-android
Aug 30, 2024 19:10:04.544 [135625705532216] ERROR - [Req#2d95] TranscodeUniversalRequest: unable to get container: /library/metadata/53735?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&includeBandwidths=1&offset=-1&X-Plex-Incomplete-Segments=1&X-Plex-Session-Identifier=aa20cdf8406d3c6c-com-plexapp-android
Aug 30, 2024 19:10:04.544 [135625705532216] WARN - [Req#2d95] Failed to obtain a streaming resource for direct play of part 136951
Aug 30, 2024 19:10:24.552 [135625554537272] ERROR - [Req#2dab] HTTP 408 downloading url http://127.0.0.1:32400/library/metadata/53735?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&includeBandwidths=1&offset=-1&X-Plex-Incomplete-Segments=1&X-Plex-Session-Identifier=aa20cdf8406d3c6c-com-plexapp-android
Aug 30, 2024 19:10:24.552 [135625688755000] ERROR - [Req#2dab] TranscodeUniversalRequest: unable to get container: /library/metadata/53735?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&includeBandwidths=1&offset=-1&X-Plex-Incomplete-Segments=1&X-Plex-Session-Identifier=aa20cdf8406d3c6c-com-plexapp-android
Aug 30, 2024 19:10:25.931 [135625776835384] WARN - Held transaction for too long (/home/runner/actions-runner/_work/plex-media-server/plex-media-server/Statistics/StatisticsManager.cpp:294): 0.240000 seconds
Aug 30, 2024 19:10:26.918 [135625646811960] INFO - [Req#2dec] AutoUpdate: no updates available
Aug 30, 2024 19:10:27.258 [135625613257528] INFO - [Req#2e02] AutoUpdate: no updates available
Aug 30, 2024 19:10:41.228 [135625776835384] WARN - Took too long (0.160000 seconds) to start a transaction on /home/runner/actions-runner/_work/plex-media-server/plex-media-server/Statistics/StatisticsManager.cpp:277
Aug 30, 2024 19:10:41.228 [135625776835384] WARN - Transaction that was running was started on thread 135625776835384 at /home/runner/actions-runner/_work/plex-media-server/plex-media-server/Statistics/StatisticsBandwidth.cpp:40
Aug 30, 2024 19:10:41.358 [135625814584120] WARN - [Req#2dfa] SLOW QUERY: It took 400.000000 ms to retrieve 20 items.
Aug 30, 2024 19:10:41.393 [135625797806904] WARN - [Req#2d67] SLOW QUERY: It took 740.000000 ms to retrieve 1 items.
Aug 30, 2024 19:10:41.428 [135625676172088] WARN - [Req#2db9] SLOW QUERY: It took 220.000000 ms to retrieve 1 items.

==> Plex Media Server.log <==
Aug 31, 2024 11:43:11.399 [123138820025144] ERROR - Waited over 10 seconds for a busy database; giving up.
Aug 31, 2024 11:44:12.847 [123138815830840] ERROR - Waited over 10 seconds for a busy database; giving up.
Aug 31, 2024 11:44:12.847 [123138815830840] ERROR - Failed to begin transaction (/home/runner/actions-runner/_work/plex-media-server/plex-media-server/Statistics/StatisticsManager.cpp:277) (tries=1): Cannot begin transaction. database is locked
Aug 31, 2024 11:44:43.561 [123138815830840] WARN - Took too long (0.140000 seconds) to start a transaction on /home/runner/actions-runner/_work/plex-media-server/plex-media-server/Statistics/StatisticsManager.cpp:277
Aug 31, 2024 11:44:43.561 [123138815830840] WARN - Transaction that was running was started on thread 123138723556152 at /home/runner/actions-runner/_work/plex-media-server/plex-media-server/Statistics/StatisticsManager.cpp:277
Aug 31, 2024 11:45:45.000 [123138820025144] ERROR - Waited over 10 seconds for a busy database; giving up.

So, just in case someone else has this issue - after reading through a bunch of similar issues other people were having, I used the DBRepair tool, it didn’t really find any issues but considering this server has been upgraded for around ~4 years now it was probably due.

The original issue I had was every now and then the server would be somewhat unresponsive when I was running it as a plugin on TrueNAS Core. Considering they are no longer supporting the plugins anymore I decided to migrate my installation to a VM and docker, this is where a lot of my issues were amplified. I copied my Library directory to a NFS share, and this was the culprit for most of my issues it seems. I saw some posts from others saying this is a big no no and I can definitely confirm that!

I moved my Library directory to an iSCSI disk and my Plex instance has been rock solid for the last ~12 hours. Library scans finish within minutes compared to hours on NFS and everything is super snappy now.

So I guess the TLDR is, do not use Network File Systems for your Database :grinning:
I’m also assuming the random issues I had when it was a TrueNAS plugin was probably due to issues with the Database that DBRepair may have sorted too but time will tell for sure.

Hope this helps someone else!

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