Title: Sync Doesn&#8217;t Work
Last modified: May 1, 2025

---

# Sync Doesn’t Work

 *  Resolved Anonymous User
 * (@anonymized-23173868)
 * [1 year ago](https://wordpress.org/support/topic/sync-doesnt-work-6/)
 * The product sync on my site is not working. Getting errors such as this in the
   log…
 * [01-May-2025 14:20:53 UTC] WordPress database error Commands out of sync; you
   can’t run this command now for query SELECT * FROM wp_posts WHERE ID = 1876 LIMIT
   1 made by shutdown_action_hook, do_action(‘shutdown’), WP_Hook->do_action, WP_Hook-
   >apply_filters, WC_Post_Data::do_deferred_product_sync, array_walk, WC_Post_Data::
   deferred_product_sync, WC_Product_Variable::sync, WC_Product->save, WC_Data_Store-
   >update, WC_Product_Data_Store_CPT->update, WC_Product_Data_Store_CPT->update_post_meta,
   WC_Data_Store_WP->update_or_delete_post_meta, update_post_meta, wp_is_post_revision,
   wp_get_post_revision, get_post, WP_Post::get_instance
 * [01-May-2025 14:23:51 UTC] PHP Warning: foreach() argument must be of type array
   |object, null given in /home/example/public_html/wp-content/plugins/woocommerce-
   square/includes/Sync/Product_Import.php on line 730
 * How do I fix this so that the sync actually works?

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

 *  Thread Starter Anonymous User
 * (@anonymized-23173868)
 * [1 year ago](https://wordpress.org/support/topic/sync-doesnt-work-6/#post-18445554)
 * I’m seeing this error in the Action Scheduler page for the “wc_square_job_runner”
   event. It’s failing.
 * action marked as failed after 1200 seconds. Unknown error occurred. Check server,
   PHP and database error logs to diagnose cause.
 *  [Mahfuzur Rahman](https://wordpress.org/support/users/mahfuzurwp/)
 * (@mahfuzurwp)
 * [1 year ago](https://wordpress.org/support/topic/sync-doesnt-work-6/#post-18446362)
 * Thanks for sharing those details, that’s super helpful.
 * The errors you’re seeing suggest a couple of things going wrong during the sync
   process:
    1. **“Commands out of sync”** typically points to a MySQL issue — often caused 
       by unclosed queries or timing issues in how data is being processed during shutdown
       actions.
    2. The **`foreach()` warning** means WooCommerce Square is expecting data that 
       isn’t being returned properly — likely due to the sync process breaking earlier.
    3. The **Action Scheduler failure** (with `wc_square_job_runner`) indicates the
       job is timing out or hitting a server resource limit (like PHP max execution
       time or memory).
 * Here’s what I recommend:
    - **Check server limits:** Make sure your hosting environment allows enough 
      memory and execution time for long-running tasks. You can ask your host to
      increase values like `max_execution_time` and `memory_limit`.
    - **Clear stuck actions:** Go to **WooCommerce > Status > Scheduled Actions**,
      filter for `Failed`, and try to manually delete any `wc_square_job_runner`
      actions stuck there.
    - **Enable debugging logs:** If not already active, turn on `WP_DEBUG_LOG` in
      your `wp-config.php` to capture more detailed errors.
    - **Update everything:** Make sure WordPress, WooCommerce, and the Square plugin
      are all updated to the latest versions.
 * If the issue continues, please feel free to share a copy of your **System Status
   Report** and any relevant error log under WooCommerce > Status > Logs. You could
   copy and paste it via [https://gist.github.com/](https://gist.github.com/) and
   send the link here.
 * Let us know how it goes!
 *  Plugin Support [Kay U a11n](https://wordpress.org/support/users/kingsleyinfo/)
 * (@kingsleyinfo)
 * [1 year ago](https://wordpress.org/support/topic/sync-doesnt-work-6/#post-18480019)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved.
 * If you have a few minutes, we’d love if you could leave us a review: [https://wordpress.org/support/plugin/woocommerce-square/reviews/](https://wordpress.org/support/plugin/woocommerce-square/reviews/)

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

The topic ‘Sync Doesn’t Work’ is closed to new replies.

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

 * 3 replies
 * 3 participants
 * Last reply from: [Kay U a11n](https://wordpress.org/support/users/kingsleyinfo/)
 * Last activity: [1 year ago](https://wordpress.org/support/topic/sync-doesnt-work-6/#post-18480019)
 * Status: resolved