• [Tue May 12 11:47:23.540610 2026] [lsapi:error] [pid 1842701:tid 1842712] [client 109.234.160.63:0] [host xxx.xx] Backend fatal error: PHP Fatal error:  Uncaught TypeError: mysqli_get_server_info(): Argument #1 ($mysql) must be of type mysqli, null given in /home/xxxx/xxxx/wp-includes/class-wpdb.php:4149
    Stack trace:
    #0 /home/xxxx/xxxx/wp-includes/class-wpdb.php(4149): mysqli_get_server_info()
    #1 /home/xxxx/xxxx/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php(455): wpdb->db_server_info()
    #2 /home/xxxx/xxxx/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php(644): ActionScheduler_DBStore->get_query_actions_sql()
    #3 /home/xxxx/xxxx/wp-content/plugins/woocommerce/packages/action-scheduler/classes/abstracts/ActionScheduler_Store.php(131): ActionScheduler_DBStore->query_actions()
    #4 /home/xxxx/xxxx/wp-content/plugins/woocommerce/packages/action-scheduler/functions.php(415): ActionScheduler_Store->query_action()
    #5 [internal function]: as_has_scheduled_action()
    #6 /home/xxxx/xxxx/wp-content/plugins/woocommerce/src/Internal/BatchProcessing/BatchProcessingController.php(554): call_user_func()
    #7 /home/xxxx/xxxx/wp-content/plugins/woocommerce/src/Internal/BatchProcessing/BatchProcessingController.php(86): Automattic\\WooCommerce\\Internal\\BatchProcessing\\BatchProcessingController->remove_or_retry_failed_processors()
    #8 /home/xxxx/xxxx/wp-includes/class-wp-hook.php(341): Automattic\\WooCommerce\\Internal\\BatchProcessing\\BatchProcessingController->{closure:Automattic\\WooCommerce\\Internal\\BatchProcessing\\BatchProcessingController::__construct():85}()
    #9 /home/xxxx/xxxx/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters()
    #10 /home/xxxx/xxxx/wp-includes/plugin.php(522): WP_Hook->do_action()
    #11 /home/xxxx/xxxx/wp-includes/load.php(1308): do_action()
    #12 [internal function]: shutdown_action_hook()
    #13 {main}
    thrown in /home/xxxx/xxxx/wp-includes/class-wpdb.php on line 4149

    Hi, we’re seeing several of these errors in our recent server log. Not sure when these happen or what is going wrong but… is this a known issue in WooCommerce?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @ravanh,

    Thanks for sharing the full stack trace. That’s really helpful!

    What’s happening here is that Action Scheduler is trying to query the database during PHP’s shutdown sequence, but by that point the MySQL connection has already been closed by the server. Since the error fires after the response has been sent, it’s not interrupting any user-facing requests. It’s log noise rather than a functional problem, but it’s still worth investigating properly.

    This often occurs on LiteSpeed-based hosting (which your log prefix confirms) where database connections are freed earlier than other server configurations.

    To help dig further, could you share your System Status Report? Go to WooCommerce → Status → Get system report, paste it at https://pastebin.com and share the link here. We’d like to check your WooCommerce version, PHP version, and hosting environment in particular.

    In the meantime, are you noticing any actual functional issues on the site? Like slow admin, stuck orders, checkout problems, or is it purely the log entries?

    Looking forward to your response.

    Thread Starter Rolf Allard van Hagen

    (@ravanh)

    Hi @frankremmy thanks for your explanation. Here is the system report https://pastebin.com/b1BccSrr (will expire in a week)

    We are indeed running into issues like 504 responses and “database gone away” responses. They seem to occur only periodically, in spurts, then calm for a while. Weird but it does seem to be in line with your explanation…

    So these mysqli_get_server_info(): Argument #1 ($mysql) must be of type mysqli, null given errors are likely a result of that same issue?

    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @ravanh,

    Thanks for the system status and the additional context.

    Yes, exactly right. The mysqli_get_server_info fatal errors are a symptom of the same underlying issue, not a separate problem. Here’s what’s happening: when the database connection drops mid-request (causing the “MySQL server has gone away” error), WooCommerce’s shutdown hooks still fire at the end of the PHP request cycle, but by that point the $wpdb connection object is null. When Action Scheduler then tries to query the database during that shutdown sequence, it fatals because there’s nothing to connect to. Fix the root cause and both errors go away.

    The intermittent 504s and database connection drops are a hosting infrastructure issue rather than anything WooCommerce is causing. The pattern you’re describing (sporadic bursts, then calm) is typical of a few things worth investigating with your host:

    • Database connection pool exhaustion – too many concurrent connections exceeding the server’s limit, causing new requests to get dropped temporarily
    • MySQL wait_timeout or interactive_timeout being too low — connections being closed by the server before PHP has finished with them
    • Memory or CPU hitting limits periodically under load, causing MySQL to restart or drop connections

    I’d recommend contacting your hosting provider and sharing the error logs with them. Ask them specifically to check MySQL connection limits, wait_timeout settings, and whether there are any resource spikes correlating with when the errors occur.

    One other thing we noticed in your system status: your Daily Cron is not scheduled. This can compound background processing issues. Please go to WooCommerce → Status → Tools and reschedule the cron jobs.

    I hope that helps point you in the right direction!

    Hi, thanks for the suggestions!

    Please go to WooCommerce → Status → Tools and reschedule the cron jobs.

    Is that the tool called Re-schedule expired transient files cleanup or are there more?

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    The “Re-schedule expired transient cleanup” option is only for clearing temporary cached data and is unrelated to WooCommerce cron scheduling.

    The log you shared initially, indicates the site lost its database connection during execution, and afterward WooCommerce’s Action Scheduler tried to run a database query using an invalid/null MySQL connection.

    The key part is:

    mysqli_get_server_info(): Argument #1 ($mysql) must be of type mysqli, null given

    That means the $wpdb database connection object became null, usually because:

    • The MySQL server temporarily disconnected
    • The database server restarted
    • The connection timed out
    • The hosting server ran out of resources (CPU/RAM/connections)

    So this is generally related to an underlying hosting/database stability issue. I would suggest contacting your hosting provider and asking them to review the server logs to identify what is exactly causing the issue. They should be able to help you resolve it.

    Let us know what they suggest.

    Hi @shahzeenfarooq yes I’ve contacted the hosting provider. The issue is under review…

    Can you tell me which Status > Tools to use to reschedule cron jobs as @frankremmy suggested needs to be done?

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thank you for the update.

    Sorry for the confusion earlier by default, there is no built-in option under WooCommerce → Status → Tools to manually re-schedule the wc_admin_daily cron job.

    I would suggest asking your hosting provider to check whether the wc_admin_daily event is running properly on the server. Alternatively, you can use the WP Crontrol plugin to manually create or re-schedule the cron event.

    Here are the steps you can follow:

    1. Click “Add Cron Event”
    2. Fill in the fields as follows:

    Hook name

    wc_admin_daily

    Arguments

    • Leave this field empty

    Next run

    • Select Now (or set a time a few minutes in the future)

    Recurrence

    • Select Once Daily
    1. Click Add Event


    Let us know if that work for you

    Thanks @shahzeenfarooq, I followed the steps and the wc_admin_daily hook now appears in the cron events list with action Automattic\WooCommerce\Internal\Admin\Events->do_wc_admin_daily()

    Would you know how this event could go missing? It was never actively deleted…

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    The wc_admin_daily event is normally created automatically by WooCommerce, so it should not disappear under normal conditions.

    If it was missing, it usually means one of the following happened:

    • It was not properly re-registered after an update or a temporary failure
    • It was removed or overwritten by another plugin, theme, or cleanup tool
    • WP-Cron was not running correctly for a period of time
    • The cron entry was lost due to a database or cron array issue

    There is no indication that it was manually deleted it typically happens due to system-level behavior rather than user action.

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.