Plex Server crashes / hangs due to busy / locked database

Server Version#: 1.32.1.6999
Player Version#: All / not relevant
Server OS: Ubuntu 22.04.2 LTS
Server-CPU: Intel(R) Core™ i7-8700 CPU @ 3.20GHz
Memory: 64GB

Hi,

since two weeks (the issue ocurred for the first time on May 2), my plex server regurlary stops responding to any sort of request. When trying to access Plex web, the website loads indefinitely. This happens at least once per day and can only be resolved by restarting the docker container.
Looking into the logs, the issue seems to be related to a locked database. Here is an excerpt of the log:

May 16, 2023 16:49:02.961 [140330846280504] ERROR - [Req#2fba12] Waited over 10 seconds for a busy database; giving up.
May 16, 2023 16:49:03.128 [140330943400760] ERROR - [Req#2fb9f1] Waited over 10 seconds for a busy database; giving up.
May 16, 2023 16:49:03.492 [140330848389944] ERROR - [Req#2fb9f8] Waited over 10 seconds for a busy database; giving up.
May 16, 2023 16:49:03.751 [140330821765944] ERROR - [Req#2fba08] Waited over 10 seconds for a busy database; giving up.
May 16, 2023 16:49:03.939 [140330812316472] DEBUG - [Req#2fba17] 36 threads are waiting on db connections held by threads: 140331570617144,140330848389944,140331339270968,140331180575544,140330943400760,140330846280504,140330828880696,140331249810232,140330831252280,140331404532536,140331132595000,140330833361720,140330818644792,140331021331256,140330941291320,140330861046584,140330945510200,140331240684344,140331134704440,140330821765944
May 16, 2023 16:49:03.939 [140331313314616] DEBUG - 36 threads are waiting on db connections held by threads: 140331570617144,140330848389944,140331339270968,140331180575544,140330943400760,140330846280504,140330828880696,140331249810232,140330831252280,140331404532536,140331132595000,140330833361720,140330818644792,140331021331256,140330941291320,140330861046584,140330945510200,140331240684344,140331134704440,140330821765944

The log is full of these messages. I can provide the complete debug log on request, but I would like to avoid posting it publicly, because it contains sensitive information (usernames).

I already tried to optimize the DB, cleaned up the packages and I even tried to repair the database with PlexDBRepair (GitHub - ChuckPa/PlexDBRepair: Database repair utility for Plex Media Server databases), running ./DBRepair.sh stop check repair reindex start exit. The utility worked fine, but Plex keeps hanging up.

I am now out of ideas and any help would be greatly appreciated.

I’m running into this issue as well. Have you ever run 3rd party tools against Plex, like Plex-Meta-Manager (PMS)?

@ChuckPa fyi

I have been running Plex-Auto-Languages but stopped it after the first few crashes.

Did the crashes occur around the time you started using the tool? Or have you been using it a long time?

No I have been using it for much longer. I don’t recall changing anything in my setup around the time the issue started.

Edit: I just realized that i forgot to take Plex-Auto-Languages out of my updater script, so it was accidentally started up again. I shut it off for good now, let’s see if Plex keeps crashing. Do you have evidence that it might be related to third-party services?

Edit2: No more crashes since shutting down Plex-Auto-Language 5 days ago. Looks like that really was what caused the DB hangups.

Hello,

I also have the crashing issue. Would you tell me how and where I can stop “ Plex-Auto-Language”

This is a third party service that I had running independent of Plex. If you have to ask, you will not have this running.

This was also happening to me on macOS with an m2 mini. I didn’t get database errors, I just got error 0 exits which means it was gently shut down without error if I’m not mistaken. Stopped my auto languages container and no more shutdowns.

Edit: I lied. It’s failing after scheduled maintenance even with the container off. I have also done DB repairs and it’s still happening.

Guys we discover that one of the Movie create this issue. we erased that movie and the crashing has been fixed.

1 Like

Thanks you for posting this. I think my show “The Boys” is causing my crashing issues. It’s been fine the whole night and so far this whole morning up until a few minutes ago when my sister started watching The Boys. It crashed then. Very curious as to why this is happening now out of no where.

1 Like

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