Browsing content on Apple TV causes Plex server to lock up

I am having issues where browsing through my Plex library using the Apple TV app is causing the entire server to lock up. I can browse normally through my library, but after clicking on a movie or TV show season, thumbnails will not load for the episodes or the actors, and the entire server locks up and goes offline. Sometimes, it will take 5-10 minutes for the server to become responsive again, and sometimes I have to reboot the docker container before it will start working. While the server is still locked up, the Plex process uses 0% CPU usage, and IO wait is also at 0%. When trying to click on a TV show episode to play it, Plex does nothing. This happens about 50% of the time with movies, and 100% of the time with TV shows. I have tested using the browser and iOS apps, but the Apple TV app is the only one that has the issue.

I have run the “Clean Bundles” and “Optimize Database” options, but they did not help. I also connected to the Plex sqlite database and ran the check DB script, but it said the database was OK.

Server: Raspberry Pi 4, 8gb running Ubuntu for arm64. All software updates installed, Docker at latest version.
Server Version#: 1.24.1.4931
Player Version#: 7.23 (1076)

Apple TV player log: logging-2.zip (349.9 KB)
Plex server log: Plex Media Server Logs_2021-09-08_22-22-13.zip (2.6 MB)

Database deadlock.

When is the last time the database was optimized ?

Sep 08, 2021 21:45:46.556 [0xffffb83f6aa8] DEBUG - Auth: authenticated user 1 as Smith8154
Sep 08, 2021 21:45:49.533 [0xffffb8d60aa8] DEBUG - player q2y2s561zag1c3s3yccs41ty was last refreshed 30 seconds ago
Sep 08, 2021 21:45:53.293 [0xffffb83f6aa8] DEBUG - Auth: authenticated user 1 as Smith8154
Sep 08, 2021 21:45:53.312 [0xffffb83f6aa8] DEBUG - Auth: authenticated user 1 as Smith8154
Sep 08, 2021 21:45:57.506 [0xffffb7387aa8] WARN - SLOW QUERY: It took 2040.000000 ms to retrieve 1 items.
Sep 08, 2021 21:45:57.506 [0xffffb7059aa8] WARN - SLOW QUERY: It took 1670.000000 ms to retrieve 1 items.
Sep 08, 2021 21:45:57.506 [0xffffb6e3faa8] WARN - SLOW QUERY: It took 1430.000000 ms to retrieve 1 items.
Sep 08, 2021 21:45:57.508 [0xffffb6f1aaa8] WARN - SLOW QUERY: It took 1550.000000 ms to retrieve 1 items.
Sep 08, 2021 21:45:57.508 [0xffffb711faa8] WARN - SLOW QUERY: It took 1830.000000 ms to retrieve 1 items.
Sep 08, 2021 21:45:57.509 [0xffffb6f89aa8] WARN - SLOW QUERY: It took 1560.000000 ms to retrieve 1 items.
Sep 08, 2021 21:45:57.514 [0xffffb8039aa8] WARN - SLOW QUERY: It took 3300.000000 ms to retrieve 1 items.
Sep 08, 2021 21:45:57.514 [0xffffb7d09aa8] WARN - SLOW QUERY: It took 2820.000000 ms to retrieve 1 items.
Sep 08, 2021 21:45:57.520 [0xffffb71f3aa8] WARN - SLOW QUERY: It took 1980.000000 ms to retrieve 4 items.
Sep 08, 2021 21:45:57.524 [0xffffb71d0aa8] WARN - SLOW QUERY: It took 1970.000000 ms to retrieve 4 items.
Sep 08, 2021 21:45:57.532 [0xffffb7ca5aa8] DEBUG - Activity: registered new activity 16cfa60d-302a-48ab-9c75-53c08189d94b - "Refreshing"
Sep 08, 2021 21:45:57.533 [0xffffb7d2caa8] DEBUG - Activity: updated activity 57472976-0dc3-40e7-9779-30d7a4339f3c - completed 0.0% - Refreshing
Sep 08, 2021 21:45:57.537 [0xffffb805caa8] WARN - Took too long (2.000000 seconds) to start a transaction on ../Statistics/StatisticsManager.cpp:249
Sep 08, 2021 21:45:57.537 [0xffffb6e62aa8] WARN - SLOW QUERY: It took 470.000000 ms to retrieve 1 items.
Sep 08, 2021 21:45:57.539 [0xffffb79e4aa8] WARN - SLOW QUERY: It took 2380.000000 ms to retrieve 1 items.

I optimized it twice today.

The database is living on a network share since SD cards are unreliable. The network share is on a RAID 1 SSD array.

Network share is extremely unreliable unless you do it perfectly.

I show how to do that here

Really NOT advised.

How about an iSCSI target ? That’ll be secure enough and won’t lock on you.

The fundamental issue here is file locking on the block device – none of which is guaranteed over any network sharing protocol except when the target is an iSCSI device.

I figured it may have been because of the network share for the database files, but I never would have guessed it was because it couldn’t lock them properly. After creating an iSCSI share and moving the DB/config files over, it’s working perfectly. Thanks for the quick resolution!

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