• Resolved SS88 LLC

    (@ss88_uk)


    Hi Ollie,

    A new one! This happened after I upgraded to the most recent version. Unfortunately i’m unable to keep it installed as it happens even with a new installation once object-cache.php is dropped in.

    PHP v7.4.33
    WP v6.1.1

    Stack trace:
    2023/02/17 19:45:34 [error] 20347#20347: *586511 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function lastErrorMsg() on null in /home/XXX/webapps/XXX/wp-content/object-cache.php:450
    #10 [" while reading response header from upstream, client: 141.101.98.123, server: XXX.org, request: "GET /wp-admin/options-general.php?page=sqlite_object_cache_settings HTTP/2.0", upstream: "fastcgi://unix:/var/run/XXX.sock:", host: "www.XXX.org", referrer: "https://www.XXX.org/wp-admin/plugins.php"
    #9 /home/XXX/webapps/XXX/wp-includes/class-wp-fatal-error-handler.php(47): load_default_textdomain()
    #8 /home/XXX/webapps/XXX/wp-includes/l10n.php(866): determine_locale()
    #7 /home/XXX/webapps/XXX/wp-includes/l10n.php(139): get_locale()
    #6 /home/XXX/webapps/XXX/wp-includes/l10n.php(63): get_option()
    #5 /home/XXX/webapps/XXX/wp-includes/option.php(165): wp_cache_get()
    #4 /home/XXX/webapps/XXX/wp-content/object-cache.php(2172): WP_Object_Cache->get()
    #3 /home/XXX/webapps/XXX/wp-content/object-cache.php(1555): WP_Object_Cache->cache_item_exists()
    #2 /home/XXX/webapps/XXX/wp-content/object-cache.php(1233): WP_Object_Cache->getone()
    #1 /home/XXX/webapps/XXX/wp-content/object-cache.php(1267): WP_Object_Cache->open_connection()
    #0 /home/XXX/webapps/XXX/wp-content/object-cache.php(476): WP_Object_Cache->error_log()
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author OllieJones

    (@olliejones)

    Thanks for this report, Steven. I am investigating.

    Plugin Author OllieJones

    (@olliejones)

    Fixed in 1.2.2. Thanks again for the report.

    Root cause: loading the l12n text domain uses options. Those in turn use the object cache, and/or $wpdb. So if either of those subsystems is compromised l12n won’t work.

    Thread Starter SS88 LLC

    (@ss88_uk)

    Thanks @olliejones! Much appreciated for the fast resolution.

    I will try today. Any errors, I’ll report back.

    Thread Starter SS88 LLC

    (@ss88_uk)

    Hi @olliejones, a different error this time!

    Stack trace:
    #10 /home/XXX/webapps/XXX/wp-load.php(50...PHP message: sqlite_object_cache failure, deleting sqlite files to retry. 3PHP message: PHP Fatal error:  Uncaught Error: Call to a member function bindValue() on null in /home/XXX/webapps/XXX/wp-content/object-cache.php:1276
    #9 /home/XXX/webapps/XXX/wp-config.php(66): require_once('/home/XXX/weba...')
    #8 /home/XXX/webapps/XXX/wp-settings.php(160): wp_not_installed()
    #7 /home/XXX/webapps/XXX/wp-includes/load.php(771): is_blog_installed()
    #6 /home/XXX/webapps/XXX/wp-includes/functions.php(1760): wp_cache_get()
    #5 /home/XXX/webapps/XXX/wp-content/object-cache.php(2178): WP_Object_Cache->get()
    #4 /home/XXX/webapps/XXX/wp-content/object-cache.php(1561): WP_Object_Cache->cache_item_exists()
    #3 /home/XXX/webapps/XXX/wp-content/object-cache.php(1239): WP_Object_Cache->getone()
    #2 /home/XXX/webapps/XXX/wp-content/object-cache.php(1273): WP_Object_Cache->open_connection()
    #1 /home/XXX/webapps/XXX/wp-content/object-cache.php(477): WP_Object_Cache->actual_open_connection()
    Plugin Author OllieJones

    (@olliejones)

    That message comes from the “oh no broken sqlite database” code path.

    Is there any chance you’re using wp-cli ? Is it possible wp-cli runs with a different user than your web server? This can set protections incorrectly on your cache files.

    Does anything change if, in your wp-config.php file, you set WP_SQLITE_OBJECT_CACHE_JOURNAL_MODE to “MEMORY” ? That makes SQLite refrain from creating two extra files *.sqlite-wal and *.sqlite-shm. Those files’ protections can also be set incorrectly.

    If you use wp-cli I suggest (on Linux) that you use

    sudo -u www-data wp whatever

    to run your commands.

    • This reply was modified 2 years, 1 month ago by OllieJones.
    Thread Starter SS88 LLC

    (@ss88_uk)

    Hi @olliejones,

    I found the error after some digging. It’s the WP_CACHE_KEY_SALT inside create_database_path.

    For me, my WP_CACHE_KEY_SALT looks something like this (changed for obvious reasons ??):

    x,Ks>eT];Vd=hnc[!DS:*A}<Ws%~/xL6SsWILY}@

    It’s attempting to create that database file with all those lovely characters in, which is obviously failing. I’m on Linux, not sure about Windows.

    Happy coding!

    Plugin Author OllieJones

    (@olliejones)

    Doh! (smacks forehead!) I’ll sanitize the salt. https://github.com/OllieJones/sqlite-object-cache/issues/27

    Version 1.2.3.

    Thanks for your patience and your help.

    Plugin Author OllieJones

    (@olliejones)

    This is due to an SQLite lock timeout.

    SQLite Object Cache: handle_put database is locked (5) Unable to execute statement: database is locked (0) #0 /home/xphsfeaf/public_html/webhost/mysite.com/wp-content/object-cache.php(1434): SQLite3Stmt->execute()

    Timeouts occur when a SQLite database write operation takes longer than five seconds to complete. This can happen because your SQLite files are on network-attached storage, or because of heavy concurrent use.

    To move the file try something like this in wp-config.php . It puts the file on the /tmp directory, which is usually on a high-speed local file system.

    define( 'WP_SQLITE_OBJECT_CACHE_DB_FILE', '/tmp/mysite-object-cache.sqlite' );

    You can increase the timeout. This makes it ten seconds rather than five. That may help.

    define( 'WP_SQLITE_OBJECT_CACHE_TIMEOUT', 10000 );

    Finally, some large sites may have so much traffic that a client server object cache like redis is a more scalable solution.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PHP Fatal error: Uncaught Error: Call to a member function lastErrorMsg()’ is closed to new replies.