PMS has become increasingly unstable recently

Server Version#: 1.15.5.994
Player Version#: n/a
Logs: Plex Media Server Logs_2019-05-01_10-54-02.zip (4.1 MB)

Nothing much has changed with my server environment other than PMS version upgrades and the routine library additions. I have already manually verified my database is optimized and free from corruption by dumping and reimporting it.
Over the past 3-4 weeks, my PMS has routinely, after 36 to 48 hours of running, crashed. Ubuntu systemd always logs the following immediately before the crash:

Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:25:13 nix14 sh[22200]: Sqlite3: Sleeping for 200ms to retry busy DB.
Apr 29 21:49:20 nix14 sh[22200]: *** Error in `/usr/lib/plexmediaserver/Plex Media Server': double free or corruption (!prev): 0x00007fa5a05fe8d0 ***
Apr 29 21:49:20 nix14 sh[22200]: ======= Backtrace: =========
...
Apr 29 21:49:21 nix14 sh[22200]: ****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /var/lib/plexmediaserver/Librar
Apr 29 21:51:50 nix14 systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=134/n/a

Today’s was
*** Error in '/usr/lib/plexmediaserver/Plex Media Server': munmap_chunk(): invalid pointer: 0x0000000000958dd8 ***
But the systemd log is full of Sqlite3: Sleeping for 200ms to retry busy DB entries throughout usage.
My library database is stored on a SSD RAID1 capable of over 500MB/s non-cached reads and over 300MB/s writes. The same volume is used for transcoding which handles 8 concurrent users without an issue so I’m baffled as to why the SQL database is running into so many locks. Additionally, these crashes can occur when there is no or little activity on the server. I cannot find in the PMS logs the warning that might correspond to these Sqlite3 errors in systemd. I’ve seen a few others recently share the same experience on these forums with little or no feedback from Plex yet:
https://forums.plex.tv/search?q=Sleeping%20for%20200ms

Historically, I only needed to restart my PMS host about monthly for routine patch management and the PMS service only during manual version upgrades, but over the past month I’ve had to intervene manually to restart the service 3-4 times per week.

I am in the same boat with unraid.

PMSLogs are filled with the 200ms line and don’t show anything else usefull

I haven’t been able to recreate the crash consistently it just goes down randomly for me.

1 Like

I looked through your logs. The only references to the word “Sleeping” were in titles.
Would it be possible to capture the logs and post those logs here when you do find them?

As stated, the warnings about sqlite busy come from the process output to systemd and are not found in pms logs.
Here are the most recent two crash events of PMS which I’ve already correlated to PMS.log for the same time range and do not see anything jumping out as alarming other than the Crash: Crash reporting disabled which I’ve now enabled so you guys can share in all the dumps with me :wink: hastebin

munmap_chunk(): invalid pointer and double free or corruption (!prev) are both indicative of C++ failure to pass a valid pointer to free(). I have no idea if the sqlite log entries are even related because they occur so frequently it could be that they will appear nearby a crash no matter what.

With regard to PMS crashing with the “double free or corruption (!prev)” error, it has been discussed and troubleshot extensively in this thread:

Just pointing it out to make sure you’re aware of its existence and the current status of the issue. It may or may not be related to your situation, but it looks very similar.

1 Like

Thanks @pshanew - I think we can abandon this thread for now until that issue is resolved. The Sqlite3 busy issue is likely unrelated after all.

Plex Media Server Beta 1.16.0.1220-147963d87 has just been released with a fix for crashes manifesting themselves as double free or heap corruptions

See Release Notice Plex Media Server

  • (Playback) The server could crash when a transcode session finished. These manifested as heap corruptions or double-frees (#9801 #9883 #9938 #9940 #9950)

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