• Resolved alexhuchasheva

    (@alexhuchasheva)


    Hello Jetpack Support team,

    We’re experiencing recurring database errors related to Jetpack Sync and the WooCommerce batch processor on our site.

    Here are repeated log entries from our error_log file:

    [13-Oct-2025 07:58:53 UTC] WordPress database error Commands out of sync; you can't run this command now for query SELECT option_value FROM wp_options WHERE option_name = 'jpsq_sync_checkout' made by shutdown_action_hook, do_action('shutdown'), WP_Hook->do_action, WP_Hook->apply_filters, Automattic\Jetpack\Sync\Sender->do_sync, Automattic\Jetpack\Sync\Dedicated_Sender::spawn_sync, Automattic\Jetpack\Sync\Queue->is_locked, Automattic\Jetpack\Sync\Queue->get_checkout_id [13-Oct-2025 07:58:53 UTC] WordPress database error Commands out of sync; you can't run this command now for query SELECT COUNT(*) FROM wp_jetpack_sync_queue WHERE queue_id = 'sync' made by shutdown_action_hook, do_action('shutdown'), WP_Hook->do_action, WP_Hook->apply_filters, Automattic\Jetpack\Sync\Sender->do_sync, Automattic\Jetpack\Sync\Dedicated_Sender::spawn_sync, Automattic\Jetpack\Sync\Queue->size, Automattic\Jetpack\Sync\Queue\Queue_Storage_Table->get_item_count

    These errors appear every few minutes, always involving:

    • Automattic\Jetpack\Sync\Sender->do_sync
    • Automattic\Jetpack\Sync\Queue->is_locked / get_checkout_id / size
    • and occasionally overlap with Automattic\WooCommerce\Internal\BatchProcessing\BatchProcessingController queries.

    The issue seems to be triggered during the shutdown hook, which suggests a race condition or database connection conflict between Jetpack Sync and WooCommerce’s Action Scheduler.

    Environment details:

    • WordPress: latest stable
    • WooCommerce: latest stable
    • Jetpack: latest version (active modules: Sync, Site Stats, Protect)
    • Hosting: Hostinger
    • PHP 8.2
    • No persistent object cache enabled

    These errors correlate with periodic CPU spikes, so I suspect the sync process may be looping or locking the DB connection during shutdown.

    Could you please confirm:

    1. Whether this is a known Jetpack Sync issue or a compatibility problem with the new WooCommerce batch processor?
    2. If there’s a way to safely delay or isolate Jetpack’s sync process from running on shutdown_action_hook to avoid MySQL connection conflicts?

    Thank you for your help.

    Best regards,
    Aleksandra

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support lastsplash (a11n)

    (@lastsplash)

    Hi @alexhuchasheva

    This happens from time to time, and it has been logged by our development team.

    In past situations, adding this code snippet (either via your theme’s functions.php, a plugin like Code Snippets, or a functionality plugin has resolved the issue for customers:

    add_action( 'shutdown', 'wordpress_check_database_connection', 0 );
    function wordpress_check_database_connection() {
    global $wpdb;

    $wpdb->check_connection();
    }

    Please add the snippet above and let us know if you continue to see the issue.

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hello @alexhuchasheva,

    Do you have updates about that, do you still need help? We usually close inactive threads after one week of no movement, but we want to make sure we’re all set before marking it as solved. Thanks!

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

The topic ‘Database errors from Jetpack Sync’ is closed to new replies.