Title: Too Many Database Errors About BatchProcessing
Last modified: December 28, 2025

---

# Too Many Database Errors About BatchProcessing

 *  Resolved [emree](https://wordpress.org/support/users/emree/)
 * (@emree)
 * [5 months, 2 weeks ago](https://wordpress.org/support/topic/too-many-database-errors-about-batchprocessing/)
 * Hi, my website has too many these errors in debug.log . I guess it’s related 
   to some triggering by “shutdown” event from the woocommerce. 
   [https://wordpress.org/plugins/woocommerce-legacy-rest-api/](https://wordpress.org/plugins/woocommerce-legacy-rest-api/)
   is enabled in my website. HPOS is never enabled. Hosting package has 4 GB Ram
   support.I’m using Woodmart, Jetpack, Facebook for Woocommerce, Google for Woocommerce,
   Product Feed PRO for WooCommerce. Sample errors:‘wc_pending_batch_processes’ 
   LIMIT 1 made by shutdown_action_hook, do_action(‘shutdown’), WP_Hook->do_action,
   WP_Hook->apply_filters, Automattic\WooCommerce\Internal\BatchProcessing\BatchProcessingController-
   >Automattic\WooCommerce\Internal\BatchProcessing{closure}, Automattic\WooCommerce\
   Internal\BatchProcessing\BatchProcessingController->remove_or_retry_failed_processors,
   Automattic\WooCommerce\Internal\BatchProcessing\BatchProcessingController->get_enqueued_processors,
   get_option [27-Dec-2025 23:18:07 UTC] WordPress database error Commands out of
   sync; you can’t run this command now for query SELECT a.action_id FROM wp_actionscheduler_actions
   a WHERE 1=1 AND a.hook=’wc_schedule_pending_batch_processes’ AND a.status IN (‘
   in-progress’, ‘pending’) LIMIT 0, 1 made by shutdown_action_hook, do_action(‘
   shutdown’), WP_Hook->do_action, WP_Hook->apply_filters, Automattic\WooCommerce\
   Internal\BatchProcessing\BatchProcessingController->Automattic\WooCommerce\Internal\
   BatchProcessing{closure}, Automattic\WooCommerce\Internal\BatchProcessing\BatchProcessingController-
   >remove_or_retry_failed_processors, call_user_func, as_has_scheduled_action, 
   ActionScheduler_Store->query_action, ActionScheduler_DBStore->query_actionsI 
   fixed it with that but but I’m not too sure about it.**add_action(‘init’, function(){
   remove_action( ‘shutdown’, [ Automattic\WooCommerce\Internal\BatchProcessing\
   BatchProcessingController::class, ‘shutdown’ ] ); });
 *     ```wp-block-code
       Woocommerce report:https://limewire.com/d/EPfHT#iD9TvDmP5T
       ```
   
    -  This topic was modified 5 months, 2 weeks ago by [emree](https://wordpress.org/support/users/emree/).
    -  This topic was modified 5 months, 2 weeks ago by [emree](https://wordpress.org/support/users/emree/).
    -  This topic was modified 5 months, 2 weeks ago by [emree](https://wordpress.org/support/users/emree/).
    -  This topic was modified 5 months, 2 weeks ago by [emree](https://wordpress.org/support/users/emree/).

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

 *  [Sai (woo-hc)](https://wordpress.org/support/users/saivutukuru/)
 * (@saivutukuru)
 * [5 months, 2 weeks ago](https://wordpress.org/support/topic/too-many-database-errors-about-batchprocessing/#post-18768923)
 * Hi [@emree](https://wordpress.org/support/users/emree/),
 * Thanks for the very detailed report, which helped a lot.
 * The error you’re seeing, “Commands out of sync; you can’t run this command now”,
   is coming from WooCommerce’s Batch Processing system when it runs its cleanup
   logic on the shutdown hook.
 * This is not related to HPOS (it’s disabled on your site), and it’s not a memory
   or RAM issue. What’s happening is:
 * • WooCommerce runs a batch cleanup on shutdown
   • At that moment, another plugin
   has already opened a database query and not fully closed it• MariaDB (especially
   on LiteSpeed) does not allow a second query on the same connection• MySQL then
   throws the “commands out of sync” error
 * This commonly occurs on sites with heavy Action Scheduler usage, feed/sync plugins,
   and MariaDB + caching layers.
 * You mentioned removing the WooCommerce batch shutdown handler. While this does
   suppress the error, we don’t recommend keeping this in place.
 * That shutdown handler is responsible for:
   • Cleaning up failed batch processors•
   Retrying stalled jobs• Preventing orphaned background tasks
 * Removing it can cause stuck jobs and data inconsistencies over time, so it should
   only be used temporarily for debugging.
 * **Recommended next steps**
    1. Clean up Action Scheduler
       From WooCommerce → Status → Scheduled Actions:• Bulk
       delete failed actions• Allow pending actions to complete
 * If you have WP-CLI access, you can also run:
   wp action-scheduler clean –status
   =failedwp action-scheduler run –batch-size=50
    1. Identify the plugin triggering the batch
       Temporarily disable one plugin at a
       time and monitor the logs:• Product Feed PRO• Google for WooCommerce• Facebook
       for WooCommerce
 * These are common sources of batch processors running during shutdown.
    1. Check caching / object cache
       Please confirm:• Is any object cache enabled (Redis,
       Memcached, LiteSpeed cache, etc.)?• Does disabling WP Fastest Cache change the
       behavior?
 * Caching layers can leave queries open longer than expected, which often triggers
   this error.
    1. Legacy REST API
       If you’re not actively using it, try disabling the WooCommerce
       Legacy REST API and re-test. While it’s not usually the root cause, it does 
       add additional shutdown hooks.
 * To help narrow this down further, could you confirm:
    1. Do these errors happen on every page load, or mainly during admin/cron activity?
    2. Is there any server-side object cache enabled by your host?
    3. Does disabling one of the feed plugins stop the errors? 
 * Once we know which batch source is involved, we can provide more targeted guidance.
 *  Thread Starter [emree](https://wordpress.org/support/users/emree/)
 * (@emree)
 * [5 months, 2 weeks ago](https://wordpress.org/support/topic/too-many-database-errors-about-batchprocessing/#post-18768938)
 * Hi, thank you too for your detailed answer. 
   -I installed Legacy REST API plugin
   after seeing some other errors related rest api.-I noticed it’s not related to
   plugins because that error is creating if I deactivate it. But if I enabled them,
   errors are increasing, another similar errors are coming to debug.log -I guess
   it’s related to theme which I used. It’s woodmart. But I don’t know which feature
   is causing that.-When I asked to chatgpt, it said “If you close trigger, actions
   will work in near feature by the cron job.” I’m not too sure it’s correct or 
   not. If it’s correct, delaying the db sync is not too important for me now.-If
   I clear the actions and it’s fixed, I’m afraid of that it’ll come again when 
   these actions are created again.
 *  Plugin Support [thelmachido a11n](https://wordpress.org/support/users/thelmachido/)
 * (@thelmachido)
 * [4 months, 3 weeks ago](https://wordpress.org/support/topic/too-many-database-errors-about-batchprocessing/#post-18797606)
 * It’s been a while since we heard back from you for this reason we are closing
   this thread. 
 * If WooCommerce has been useful for your store and you appreciate the support 
   you’ve received, we’d truly appreciate it if you could leave us a quick review
   here: 
 *  [https://wordpress.org/support/plugin/woocommerce/reviews/#new-post](https://wordpress.org/support/plugin/woocommerce/reviews/#new-post)
 * Feel free to open a new forum topic if you run into any other problem. 

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftoo-many-database-errors-about-batchprocessing%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [thelmachido a11n](https://wordpress.org/support/users/thelmachido/)
 * Last activity: [4 months, 3 weeks ago](https://wordpress.org/support/topic/too-many-database-errors-about-batchprocessing/#post-18797606)
 * Status: resolved