Receiving a multitude of errors that the database is busy or locked

Server Version#: 1.23.5.4862
Player Version#: Web Version 4.62.1

Receiving a multitude of errors that the database is busy or locked

Database is optimized and Running over Windows 10 20H1 in an internal SSD

12GB of RAM and i7 8th processor

Jul 28, 2021 21:01:34.710 [20120] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:34.961 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:37.811 [19880] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:37.968 [7472] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:37.968 [13616] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:38.029 [18956] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:38.122 [20120] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:38.374 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:41.409 [19880] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:41.565 [13616] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:41.687 [7472] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:41.731 [18956] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:41.822 [20120] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:42.060 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:45.134 [19880] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:45.274 [7632] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:45.291 [13616] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:45.402 [7472] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:45.457 [18956] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:45.562 [20120] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:45.778 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:48.682 [19880] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:48.791 [13616] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:48.807 [7632] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:48.886 [7472] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:48.949 [18956] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:48.980 [20120] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:49.260 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:50.755 [20120] ERROR - Soci Exception handled: sqlite3_statement_backend::loadOne: database is locked
Jul 28, 2021 21:01:52.071 [19880] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:52.133 [13616] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:52.149 [7632] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:52.243 [7472] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:52.320 [18956] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:52.663 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:55.104 [20120] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:55.414 [19880] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:55.522 [13616] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:55.538 [7632] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:55.586 [7472] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:55.711 [18956] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:56.052 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:58.493 [20120] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:58.805 [19880] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:58.915 [13616] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:58.931 [7632] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:58.977 [7472] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:59.101 [18956] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:01:59.445 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:00.907 [18956] ERROR - Soci Exception handled: sqlite3_statement_backend::loadOne: database is locked
Jul 28, 2021 21:02:01.870 [20120] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:02.229 [19880] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:02.338 [13616] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:02.352 [7632] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:02.413 [7472] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:02.944 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:05.400 [20120] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:05.649 [19880] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:05.819 [13616] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:05.835 [7632] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:05.882 [7472] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:06.069 [6456] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:06.334 [15280] WARN - Waited one whole second for a busy database.
Jul 28, 2021 21:02:08.787 [20120] WARN - Waited one whole second for a busy database.

More errors related with databse problems:

Jul 28, 2021 21:53:52.210 [1676] Advertencia — Waited one whole second for a busy database.
Jul 28, 2021 21:53:52.342 [0680] Advertencia — Waited one whole second for a busy database.
Jul 28, 2021 21:53:53.462 [18436] Advertencia — Held transaction for too long (…\Library\MetadataItem.cpp:3839): 27.140625 seconds
Jul 28, 2021 21:53:53.462 [12832] Advertencia — Took too long (22.781250 seconds) to start a transaction on …\Statistics\StatisticsManager.cpp:249
Jul 28, 2021 21:53:53.462 [12832] Advertencia — Transaction that was running was started on thread 18436 at …\Library\MetadataItem.cpp:1134
Jul 28, 2021 21:53:54.229 [12688] Advertencia — SLOW QUERY: It took 609.375000 ms to retrieve 1 items.
Jul 28, 2021 21:54:50.276 [14660] Advertencia — Waited one whole second for a busy database.
Jul 28, 2021 21:54:54.451 [14660] Advertencia — Waited one whole second for a busy database.

Jul 28, 2021 21:55:29.184 [15044] Advertencia — Waited one whole second for a busy database.
Jul 28, 2021 21:55:29.207 [2832] Advertencia — Held transaction for too long (…\Library\MetadataItem.cpp:3839): 42.125000 seconds
Jul 28, 2021 21:55:29.208 [18032] Advertencia — Took too long (30.828125 seconds) to start a transaction on …\Statistics\StatisticsManager.cpp:249
Jul 28, 2021 21:55:29.208 [18032] Advertencia — Transaction that was running was started on thread 2832 at …\Library\MetadataItem.cpp:1134
Jul 28, 2021 21:56:10.417 [15044] Advertencia — Waited one whole second for a busy database.

Please, help

These errors are causing crashes and extreme slowness in the web layer and in the loading of the Plex components and I have tried and read everything possible with no solution

I’m getting the exact same issue - my server crashed and on restart the Plex Server will run for a few minutes, but the stop. Looking at the console, all I see is the same as you above that the database is locked. How can we unlock the database/put it back into a stable state

1 Like

More errors related with databse problems:

Jul 28, 2021 21:53:52.210 [1676] Advertencia — Waited one whole second for a busy database.
Jul 28, 2021 21:53:52.342 [0680] Advertencia — Waited one whole second for a busy database.
Jul 28, 2021 21:53:53.462 [18436] Advertencia — Held transaction for too long (…\Library\MetadataItem.cpp:3839): 27.140625 seconds
Jul 28, 2021 21:53:53.462 [12832] Advertencia — Took too long (22.781250 seconds) to start a transaction on …\Statistics\StatisticsManager.cpp:249
Jul 28, 2021 21:53:53.462 [12832] Advertencia — Transaction that was running was started on thread 18436 at …\Library\MetadataItem.cpp:1134
Jul 28, 2021 21:53:54.229 [12688] Advertencia — SLOW QUERY: It took 609.375000 ms to retrieve 1 items.
Jul 28, 2021 21:54:50.276 [14660] Advertencia — Waited one whole second for a busy database.
Jul 28, 2021 21:54:54.451 [14660] Advertencia — Waited one whole second for a busy database.

Jul 28, 2021 21:55:29.184 [15044] Advertencia — Waited one whole second for a busy database.
Jul 28, 2021 21:55:29.207 [2832] Advertencia — Held transaction for too long (…\Library\MetadataItem.cpp:3839): 42.125000 seconds
Jul 28, 2021 21:55:29.208 [18032] Advertencia — Took too long (30.828125 seconds) to start a transaction on …\Statistics\StatisticsManager.cpp:249
Jul 28, 2021 21:55:29.208 [18032] Advertencia — Transaction that was running was started on thread 2832 at …\Library\MetadataItem.cpp:1134
Jul 28, 2021 21:56:10.417 [15044] Advertencia — Waited one whole second for a busy database.

Try latest build.

Ref: Plex Media Server - #450 by StSimm1

Done that - did a repair install of last release - no difference

Then please go here, where the Plex devs hangs out

My issue is not with the starting up
Plex starts without problems and stay Up

Would you mind messaging me a copy of full server logs and a copy of database. Both can be gotten from troubleshooting section of server settings. Click on my userame/avatar to see message button.

1 Like

Hi!!

I have been send you the logs of the server and the database for analysis

After forcing the update of the media server to 1.23.6.4863

Now i have this errors, related too with database problems:

Jul 29, 2021 10:17:18.531 [15684] Advertencia — Held transaction for too long (…\Library\MetadataItem.cpp:3840): 1.312500 seconds
Jul 29, 2021 10:17:31.359 [9712] Advertencia — SLOW QUERY: It took 578.125000 ms to retrieve 6 items.
Jul 29, 2021 10:17:33.796 [14216] Advertencia — SLOW QUERY: It took 453.125000 ms to retrieve 6 items.
Jul 29, 2021 10:17:44.432 [20172] Advertencia — Held transaction for too long (…\Library\MetadataItem.cpp:3840): 1.156250 seconds

I do not know what resources plex needs to host the database since being in an SSD should not be having these problems of slowness

it is a configuration problem?

i have a large library, but i supose that it shouldnt be a problem

Continue having the same errors after the update:

Jul 29, 2021 10:50:47.646 [19348] Error — Error issuing curl_easy_perform(handle): 28
Jul 29, 2021 10:50:50.266 [19348] Advertencia — Waited one whole second for a busy database.
Jul 29, 2021 10:50:53.601 [19348] Advertencia — Waited one whole second for a busy database.
Jul 29, 2021 10:50:56.930 [19348] Advertencia — Waited one whole second for a busy database.
Jul 29, 2021 10:51:00.273 [19348] Advertencia — Waited one whole second for a busy database.
Jul 29, 2021 10:51:03.610 [19348] Advertencia — Waited one whole second for a busy database.
Jul 29, 2021 10:51:06.940 [19348] Advertencia — Waited one whole second for a busy database.
Jul 29, 2021 10:53:31.167 [15632] Error — Error issuing curl_easy_perform(handle): 28
Jul 29, 2021 11:00:17.365 [9712] Error — Error issuing curl_easy_perform(handle): 28
Jul 29, 2021 11:03:46.800 [13988] Error — Error issuing curl_easy_perform(handle): 28
Jul 29, 2021 11:03:46.807 [13988] Advertencia — Error refreshing metadata for local://310988

Also make sure, that AntiVira solutions is not scanning the database

For me installing the latest patch release that came out ( 1.23.6.4881) has resolved the DB locking issue and my server is now able to allow streaming again

1 Like

I have disabled all antivirus

Where can i find this release?

In the server setting page where you see the “server” version number, the last option at the bottom of the screen is the server update channel - By default it is set to “Public”. Change to “Beta”. In the latest beta release there is fix for “database hanging in the activities table on migration” - alternatively you should be able to get it here: Media Server Downloads | Plex Media Server for Windows, Mac, Linux, FreeBSD and More

This is a beta release, so there is the risk that there could be other issues introduced with it - I’ve not noticed any on my system, but you can switch back to the public release channel after installing and/or rollback the release to the last version you had post the database lock - hopefully this being resolved like this release did for me.

Full fix list in this release:
ITEMS FIXED:

  • (Hubs) Stop showing opted out items in Merged Recently Added hubs (#12820)
  • (Music) Discovery radio only loaded the first few tracks.
  • (Scanner) Improved matching for TV episodes with names including both vertical and horizontal resolutions (#12830)
  • (Scanner) Improved matching for TV episodes with version-number suffixes (#12830)
  • (Scanner) Some episode files would get skipped if it was a low confidence match (#12861)
  • (Activity) Fix hanging in activities table db migration

I´m in the version that you say and having the same problems

VersiĂłn 1.23.6.4881

did you upgrade to that version, or were you already on it?

I’m having similar issue described in this post. I’m going to try that latest beta as you mentioned.