Frequent “Database is Locked” Errors from SQLite Object Cache Plugin
-
We recently started noticing a large number of errors in our PHP error logs that look like this:
PHP Fatal error: Uncaught SQLite3Exception: Unable to execute statement: database is locked in /wordpress/folder/path/wp-content/object-cache.php:2656
Stack trace:
#0 /wordpress/folder/path/wp-content/object-cache.php(2656): SQLite3Stmt->execute()
#1 /wordpress/folder/path/wp-content/object-cache.php(541): WP_Object_Cache->clear_flag()
#2 /wordpress/folder/path/wp-content/object-cache.php(2685): WP_Object_Cache->__construct()
#3 /wordpress/folder/path/wp-includes/load.php(893): wp_cache_init()
#4 /wordpress/folder/path/wp-settings.php(147): wp_start_object_cache()
#5 /wordpress/folder/path/wp-config.php(134): require_once('...')
#6 /wordpress/folder/path/wp-load.php(50): require_once('...')
#7 /wordpress/folder/path/wp-blog-header.php(13): require_once('...')
#8 /wordpress/folder/path/index.php(17): require('...')
#9 {main}
thrown in /wordpress/folder/path/wp-content/object-cache.php on line 2656These errors may have been occurring ever since we installed the plugin, but we only recently became aware of them.
Versions: WordPress: 6.8.1 SQLite: 3.45.1 php: 8.3.6 Server: nginx/1.24.0 Plugin: 1.5.6 APCu: 5.1.22 igbinary: 3.2.13.We’ve had multiple incidents of data loss in the past related to object caching in WordPress (while trying the “Redis Object Cache” plugin as well as a couple of others). The data losses are especially related to WooCommerce data. So, even though this current SQLite error doesn’t appear to affect our site in any obvious way, I’m concerned that some write operations could be silently failing, leading to data corruption or loss that we might only discover too late.
I found a similar support topic here, but there doesn’t seem to be a clear resolution. For context, we are not using network-attached storage.
This may be unrelated but our cached data size setting on the SQLite Object Cache plugin settings page is 1024MiB. Our site is fairly large. We increased this number by looking at the statistics page and incrementally raising the size as recommended. Maybe as a consequence of this, the statistics page of the plugin has always taken a long time (over 30 seconds) to load up. While creating this support ticket, I tried to grab a screenshot of the statistics page, but the page doesn’t even load anymore. It times out.
Besides these issues, we have not (yet?) noticed anything else. The website frontend is fast and seems to work fine.
Any insight or suggestions would be greatly appreciated.
You must be logged in to reply to this topic.