OllieJones / sqlite-object-cache

A WordPress persistent object cache for the rest of us.
GNU General Public License v2.0
25 stars 4 forks source link

Timeout issue #39

Closed wabetainfo closed 7 months ago

wabetainfo commented 7 months ago

Hi, As requested on the support forum, this the description of my website:

### wp-core ###

version: 6.4.2
site_language: en_GB
user_language: en_US
timezone: Europe/London
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: undefined
environment_type: production
user_count: 1
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /home/website/public_html
wordpress_size: 2.86 GB (3066949867 bytes)
uploads_path: /home/website/public_html/wp-content/uploads
uploads_size: 2.68 GB (2876681298 bytes)
themes_path: /home/website/public_html/wp-content/themes
themes_size: 9.06 MB (9499575 bytes)
plugins_path: /home/website/public_html/wp-content/plugins
plugins_size: 100.21 MB (105078541 bytes)
database_size: 176.72 MB (185305621 bytes)
total_size: 5.81 GB (6243514902 bytes)

### wp-dropins (1) ###

advanced-cache.php: true

### wp-active-theme ###

name: Kenta Groovy Blog (kenta-groovy-blog)
version: 1.0.0
author: WP Moose
author_website: https://www.wpmoose.com
parent_theme: Kenta (kenta)
theme_features: core-block-patterns, _infinite-scroll, widgets-block-editor, editor-style, automatic-feed-links, title-tag, post-thumbnails, align-wide, editor-styles, html5, responsive-embeds, customize-selective-refresh-widgets, editor-color-palette, starter-content, menus, widgets
theme_path: /home/website/public_html/wp-content/themes/kenta-groovy-blog

### wp-parent-theme ###

name: Kenta (kenta)
version: 1.2.7.1
author: WP Moose
author_website: https://www.wpmoose.com
theme_path: /home/website/public_html/wp-content/themes/kenta

### wp-themes-inactive (1) ###

Twenty Twenty-Four: version: 1.0, author: the WordPress team

### wp-mu-plugins (1) ###

WordPress automation by Installatron: author: (undefined), version: (undefined)

### wp-plugins-active (15) ###

AdSense Integration WP QUADS: version: 2.0.80, author: WP Quads
Async JavaScript: version: 2.21.08.31, author: Frank Goossens (futtta)
Classic Editor: version: 1.6.3, author: WordPress Contributors
Disable Search: version: 4.0, author: WABetaInfo
GDPR Cookie Compliance: version: 4.12.8, author: Moove Agency
Include Me: version: 1.3.2, author: Stefano Lissa
Jetpack: version: 12.9.3, author: Automattic
Remove Category URL: version: 1.1.6, author: Valerio Souza, Сreativemotion
Two Factor Authentication: version: 1.14.17, author: David Anderson, original plugin by Oskar Hane and enhanced by Dee Nutbourne
WP-Optimize - Clean, Compress, Cache: version: 3.2.22, author: David Anderson, Ruhani Rabin, Team Updraft
WPCode Lite: version: 2.1.7, author: WPCode
WP Reactions Lite: version: 1.3.10, author: WP Reactions, LLC
WP Rollback: version: 2.0.5, author: WP Rollback
WPS Hide Login: version: 1.9.10, author: WPServeur, NicolasKulka, wpformation
Yoast SEO: version: 21.7, author: Team Yoast

### wp-plugins-inactive (2) ###

SQLite Object Cache: version: 1.3.7, author: Oliver Jones
Wordfence Security: version: 7.11.1, author: Wordfence

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1809
imagemagick_version: ImageMagick 7.1.1-19 Q16-HDRI x86_64 21601 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 128M
upload_max_filesize: 128M
max_effective_size: 128 MB
max_file_uploads: 20
imagick_limits: 
    imagick::RESOURCETYPE_AREA: 376 GB
    imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
    imagick::RESOURCETYPE_FILE: 12288
    imagick::RESOURCETYPE_MAP: 188 GB
    imagick::RESOURCETYPE_MEMORY: 94 GB
    imagick::RESOURCETYPE_THREAD: 1
    imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, A, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, B, BAYER, BAYERA, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, C, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, FTXT, G, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K, K25, KDC, LABEL, M, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MPO, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, O, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, R, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, SCREENSHOT, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, STRIMG, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YAML, YCbCr, YCbCrA, YUV
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.27

### wp-server ###

server_architecture: Linux 4.18.0-513.9.1.lve.el8.x86_64 x86_64
httpd_software: Apache
php_version: 8.0.30 64bit
php_sapi: litespeed
max_input_variables: 1000
time_limit: 30
memory_limit: 1024M
max_input_time: 90
upload_max_filesize: 128M
php_post_max_size: 128M
curl_version: 7.87.0 OpenSSL/1.1.1w
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: true
current: 2024-01-08T18:04:23+00:00
utc-time: Monday, 08-Jan-24 18:04:23 UTC
server-time: 2024-01-08T18:04:21+00:00

### wp-database ###

extension: mysqli
server_version: 10.6.16-MariaDB-cll-lve
client_version: mysqlnd 8.0.30
max_allowed_packet: 268435456
max_connections: 1000

### wp-constants ###

WP_HOME: https://wabetainfo.com
WP_SITEURL: https://wabetainfo.com
WP_CONTENT_DIR: /home/website/public_html/wp-content
WP_PLUGIN_DIR: /home/website/public_html/wp-content/plugins
WP_MEMORY_LIMIT: 1024M
WP_MAX_MEMORY_LIMIT: 1024M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: true
WP_CACHE: true
CONCATENATE_SCRIPTS: false
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: Undefined
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable

### jetpack ###

site_id: <REDACTED>
ssl_cert: No
time_diff: undefined
version_option: 12.9.3:1703275460
old_version: 12.9.1:1702930248
public: Public
master_user: #1 <REDACTED>
is_offline_mode: off
is_offline_mode_constant: off
current_user: #1 <REDACTED>
tokens_set: Blog User
blog_token: <REDACTED>
user_token: <REDACTED>
version: 12.9.3
jp_plugin_dir: /home/website/public_html/wp-content/plugins/jetpack/
plan: free
protect_header: {"trusted_header":"REMOTE_ADDR","segments":1,"reverse":false}
full_sync: {"started":"Thu, 12 Oct 2023 00:15:11 +0000","finished":"Thu, 12 Oct 2023 00:15:15 +0000","progress":{"options":{"finished":true},"functions":{"finished":true},"constants":{"finished":true},"users":{"total":"1","sent":1,"finished":true,"last_sent":"1"},"network_options":{"finished":true}},"config":{"options":true,"functions":true,"constants":true,"users":[1],"network_options":true}}
sync_size: undefined
sync_lag: 0 seconds
full_sync_size: undefined
full_sync_lag: 0 seconds
idc_urls: {"home":"https:\/\/wabetainfo.com","siteurl":"https:\/\/wabetainfo.com","WP_HOME":"https:\/\/wabetainfo.com","WP_SITEURL":"https:\/\/wabetainfo.com"}
idc_error_option: false
idc_optin: true
cxn_tests: All Pass.

Instead, this is the error found in the debug file:

Uncaught Error: Call to undefined function __() in /home/website/public_html/wp-admin/includes/file.php:16 Stack trace: #0 /home/website/public_html/wp-content/object-cache.php(2312): require_once() #1 /home/website/public_html/wp-content/object-cache.php(587): WP_Object_Cache->delete_offending_files() #2 /home/website/public_html/wp-content/object-cache.php(433): WP_Object_Cache->open_connection() #3 /home/website/public_html/wp-content/object-cache.php(2360): WP_Object_Cache->__construct() #4 /home/website/public_html/wp-includes/load.php(856): wp_cache_init() #5 /home/website/public_html/wp-settings.php(131): wp_start_object_cache() #6 /home/website/public_html/wp-config.php(100): require_once('/home/website...') #7 /home/website/public_html/wp-load.php(50): require_once('/home/website...') #8 /home/website/public_html/wp-admin/admin.php(34): require_once('/home/website...') #9 /home/website/public_html/wp-admin/plugins.php(10): require_once('/home/website...') #10 {main} thrown in /home/website/public_html/wp-admin/includes/file.php on line 16

[05-Jan-2024 12:32:00 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function __() in /home/website/public_html/wp-admin/includes/file.php:16
Stack trace:
#0 /home/website/public_html/wp-content/object-cache.php(2312): require_once()
#1 /home/website/public_html/wp-content/object-cache.php(587): WP_Object_Cache->delete_offending_files()
#2 /home/website/public_html/wp-content/object-cache.php(433): WP_Object_Cache->open_connection()
#3 /home/website/public_html/wp-content/object-cache.php(2360): WP_Object_Cache->__construct()
#4 /home/website/public_html/wp-includes/load.php(856): wp_cache_init()
#5 /home/website/public_html/wp-settings.php(131): wp_start_object_cache()
#6 /home/website/public_html/wp-config.php(100): require_once('/home/website…’)
#7 /home/website/public_html/wp-load.php(50): require_once('/home/website...')
#8 /home/website/public_html/wp-blog-header.php(13): require_once('/home/website...')
#9 /home/website/public_html/index.php(17): require('/home/website...')
#10 {main}
  thrown in /home/website/public_html/wp-admin/includes/file.php on line 16
[05-Jan-2024 12:32:04 UTC] SQLite Object Cache: 3.39.4 no igbinary: php 8.0.30: Apache: open_connection failure database is locked (5)

To fix the timeout issue, I had to delete object-cache.php and all database files created by the plugin, then I was able to disable the plugin. It's worth noting that I have these two lines in my wp-config file:

define('WP_SQLITE_OBJECT_CACHE_DB_FILE', '/var/tmp/.a-object-cache.sqlite');
define('WP_SQLITE_OBJECT_CACHE_TIMEOUT', 15000);

I think it is also important to mention that I recently experienced a problem with the database. I don't know if the two issues are related, but I thought it was better to point it out.

Thanks for your work and dedication in investigating!

OllieJones commented 7 months ago

This is a puzzling situation. I wonder if your site is hitting some sort of MySQL deadlock; that might prevent the release of the SQLite database file. (Your out-of-sync problem with Jetpack's shutdown hook handler suggests a misbehaving plugin someplace; that error occurs when some software uses the database connection before some other use of it is completed: that is, when the misbehaving software doesn't retrieve an entire result set).

Is it possible for you to try reducing the lock wait timeout on your DBMS, temporarily? That may result in the generation of a useful error report. https://mariadb.com/kb/en/innodb-system-variables/#innodb_lock_wait_timeout

Using a MySQL client (phpmyadmin, for example) to do

SET GLOBAL innodb_lock_wait_timeout = 14;

will set the timeout to 14 seconds, just shy of the 15 seconds you use for your SQLite timeout.

The default lock wait timeout is 50 seconds. So, increasing the SQLite timeout to 20 seconds would have a similar effect (we try three times).

Thanks for your patience.

wabetainfo commented 7 months ago

Thank you for your answer. Currently, I no longer experience the out-of-sync issue, and I've noticed that your plugin is also no longer causing timeouts. I'm not sure if it's a coincidence or not, but I believe there might be a connection. After installing the latest update of your plugin, I remember my website not encountering timeout issues anymore, but they started again following the out-of-sync problem. That's why I think there could be some connection between the two cases. In case timeout issues reoccur or if the out-of-sync problem happens again (which might be the cause of the plugin experiencing timeout issues), I will follow your suggestion regarding innodb_lock_wait_timeout and provide feedback here.

Thanks for your assistance!

OllieJones commented 7 months ago

That's good news! Thanks for letting me know.