Was wondering how I can go about diagnosing an issue I keep having;
At random points during the day Plex refuses to play certain media. PlexPy will show the client Buffering and Transcode speed at 0.0. If I restart PMS then it works fine.
Server running Ubuntu 14 - PMS 1.9.3. Has happened on versions from 1.8.x upwards.
Around 80% of my media is mounted via plexdrive/EncFS - but I am sure it has happened to local media too.
What settings do I need to apply to capture sufficient logs for me to start diagnosing this issue?
I’ll grab a set of logs when it next happens - however there is nothing on the fuse mount (plexdrive) logs. Also I can literally restart PMS and play the exact same media file - and it’s pulling it from the RAM cached chunk and Plex plays it fine
If PMS plays it just fine after the initial hit then the media isn’t ‘available’ when PMS goes for it but is available after it actually does read.
Something in that mount is taking too long to complete and results in a read i/o failure
Plex never says the media isn’t available - it just sits there at 0x transcode speed.
Restarting PMS (without touching the mount) causes it to work
Additionally, if I download the file via the Plex Web interface it downloads fine.
Edit: just making sure I don’t come off as rude. I’ve talked to the plexdrive guys too and upgraded across three versions now and it persists. Additionally like I said I’m pretty sure it happens with local media too.
Ok - happened again, although this time I did some testing whilst it was “Broke”
Media on Fuse mount - doesnt play
Media on local disk - doesnt play
Sync items - fail
Sync also gives me an error reading sync database (error on iOS 11.1 latest client)
Oct 06, 2017 18:03:04.644 [0x7f6a18fee700] WARN - Waited one whole second for a busy database.
Oct 06, 2017 18:03:05.651 [0x7f6a18fee700] ERROR - Failed to begin transaction (../Playlists/PlayQueue.cpp:852) (tries=9): Cannot begin transaction. database is locked
Testing my disk read/write I get;
/dev/sda:
Timing cached reads: 13270 MB in 2.00 seconds = 6640.48 MB/sec
Timing buffered disk reads: 260 MB in 3.12 seconds = 83.43 MB/sec
However there is a conversion occuring at this time;
Total DISK READ : 20.71 M/s | Total DISK WRITE : 2.23 M/s
Actual DISK READ: 14.73 M/s | Actual DISK WRITE: 0.00 B/s
TID PRIO USER DISK READ DISK WRITE> SWAPIN IO COMMAND
20463 be/5 plex 5.98 M/s 2.23 M/s 0.00 % 17.24 % Plex Transcoder -codec:0 h264 -codec:1 ac3 -i ~5/7b8efb9d-0a9e-417d-be14-c1637c5d4df7/progress
20480 be/5 plex 0.00 B/s 0.00 B/s 0.00 % 0.00 % Plex Transcoder -codec:0 h264 -codec:1 ac3 -i ~5/7b8efb9d-0a9e-417d-be14-c1637c5d4df7/progress
1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init nomdmonddf nomdmonisw
Before I step away, there are some things you will need to do.
A. Optmize the database
Oct 05, 2017 15:51:35.360 [0x7f6a55fff700] WARN - SLOW QUERY: It took 430.000000 ms to retrieve 39 items.
Oct 05, 2017 15:51:35.400 [0x7f6a4dbff700] WARN - SLOW QUERY: It took 270.000000 ms to retrieve 39 items.
Oct 05, 2017 15:51:35.406 [0x7f6a557fe700] WARN - SLOW QUERY: It took 240.000000 ms to retrieve 39 items.
Oct 05, 2017 15:51:35.436 [0x7f6a4d3fe700] WARN - SLOW QUERY: It took 230.000000 ms to retrieve 39 items.
Oct 05, 2017 15:51:35.459 [0x7f6a587ff700] WARN - SLOW QUERY: It took 510.000000 ms to retrieve 1 items.
Oct 05, 2017 15:51:35.466 [0x7f6a54ffd700] WARN - SLOW QUERY: It took 370.000000 ms to retrieve 39 items.
Oct 05, 2017 15:51:35.468 [0x7f6a4e800700] WARN - SLOW QUERY: It took 660.000000 ms to retrieve 39 item
B. Increase the amount of entries which can be placed in the directory iNotify table (you have more than the default 8192)
Oct 05, 2017 15:52:28.160 [0x7f6a6e3ff700] ERROR - [Notify] Failed to add watch for /home/Plex/ACD/Plex/TVBoxsets/Devious Maids (28: No space left on device)
Oct 05, 2017 15:52:28.161 [0x7f6a6e3ff700] ERROR - [Notify] Failed to add watch for /home/Plex/ACD/Plex/TVBoxsets/Devious Maids/Season 4 (28: No space left on device)
Oct 05, 2017 15:52:28.162 [0x7f6a6e3ff700] ERROR - [Notify] Failed to add watch for /home/Plex/ACD/Plex/TVBoxsets/The Good Fight (28: No space left on device)
Oct 05, 2017 15:52:28.164 [0x7f6a6e3ff700] ERROR - [Notify] Failed to add watch for /home/Plex/ACD/Plex/TVBoxsets/The Good Fight/Season 1 (28: No space left on device)
Oct 05, 2017 15:52:28.169 [0x7f6a6e3ff700] ERROR - [Notify] Failed to add watch for /home/Plex/ACD/Plex/TVBoxsets/The Middleman (28: No space left on device)
Oct 05, 2017 15:52:28.170 [0x7f6a6e3ff700] ERROR - [Notify] Failed to add watch for /home/Plex/ACD/Plex/TVBoxsets/The Middleman/Season 1 (28: No space left on device)
This is becoming increasingly common. I’ve created a Linux Tip to show how to increase the kernel table size
Okay. I think I found a semi-fix. I have no idea if this will help anyone else but here it is.
I’m running plex from the official docker container. If I limit the ram on the container I no longer see this issue. Digging around I noticed Plex was using a ton of swap space. Smells like a memory leak to me.
When I limit the resources on the container I haven’t seen the issue since.
Hey everyone, I know this is an old topic at this point, but I’m still running into this issue. Now limiting the RAM isn’t solving the issue like it appeared to be previously. At this point I’ve set up a CRON job to restart the container every 12 hours. This is cutting down on the issue but it isn’t eliminating it.
To be clear every few hours, certain files will begin like they are going to play and get stuck at 33%. Immediately after restarting the container the file plays fine. I believe this issue is presenting on a variety of clients, but it primarily happens on Roku devices. I’m having trouble tracking it down since it doesn’t start playing the file it doesn’t get captured in my historical data.
If anyone has any suggestions of other posts I should look at or someone would like to help me troll through my logs and find out what the heck is going on, I’d be very appreciative.
I think the next thing I’m going to try is moving the transcode directory to a new drive and see if that helps. But I’m open to any suggestions.