Title: Sync Failed issue
Last modified: March 11, 2024

---

# Sync Failed issue

 *  Resolved [BalinJFoley](https://wordpress.org/support/users/balinjfoley/)
 * (@balinjfoley)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/sync-failed-issue/)
 * Hello, I’ve setup Woocommerce as the system of record and have many of the products
   syncing stock on variations correctly. However when I try to add new products
   into Square from Woocommerce and then manually sync them I get this error every
   time. Here’s the copy from the logs:
 * 2024-02-10T00:02:54+00:00 CRITICAL Uncaught TypeError: call_user_func_array():
   Argument #1 ($callback) must be a valid callback, function “square_stock_sync_handler”
   not found or invalid function name in /home/espirecl/public_html/wp-includes/
   class-wp-hook.php:324 Stack trace: #0 /home/espirecl/public_html/wp-includes/
   class-wp-hook.php(348): WP_Hook->apply_filters() #1 /home/espirecl/public_html/
   wp-includes/plugin.php(517): WP_Hook->do_action() #2 /home/espirecl/public_html/
   wp-content/plugins/woocommerce/includes/class-wc-api.php(161): do_action() #3/
   home/espirecl/public_html/wp-includes/class-wp-hook.php(324): WC_API->handle_api_requests()#
   4 /home/espirecl/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()#
   5 /home/espirecl/public_html/wp-includes/plugin.php(565): WP_Hook->do_action()#
   6 /home/espirecl/public_html/wp-includes/class-wp.php(418): do_action_ref_array()#
   7 /home/espirecl/public_html/wp-includes/class-wp.php(813): WP->parse_request()#
   8 /home/espirecl/public_html/wp-includes/functions.php(1336): WP->main() #9 /
   home/espirecl/public_html/wp-blog-header.php(16): wp() #10 /home/espirecl/public_html/
   index.php(17): require(‘/home/espirecl/…’) #11 {main} thrown in /home/espirecl/
   public_html/wp-includes/class-wp-hook.php on line 324
 * Thanks,
 * Balin

Viewing 5 replies - 16 through 20 (of 20 total)

[←](https://wordpress.org/support/topic/sync-failed-issue/?output_format=md) [1](https://wordpress.org/support/topic/sync-failed-issue/?output_format=md)
2

 *  Thread Starter [BalinJFoley](https://wordpress.org/support/users/balinjfoley/)
 * (@balinjfoley)
 * [2 years ago](https://wordpress.org/support/topic/sync-failed-issue/page/2/#post-17523457)
 *     ```wp-block-code
       2024-03-24T04:35:06+00:00 NOTICE Response
        Response
       code: 400
       message:
       headers: Array
       (
           [0] => HTTP/2 400
           [date] => Sun, 24 Mar 2024 04:35:06 GMT
           [content-type] => application/json
           [content-length] => 146
           [cf-ray] => 8693f3cf2e7da820-SYD
           [cf-cache-status] => DYNAMIC
           [content-encoding] => gzip
           [strict-transport-security] => max-age=631152000; includeSubDomains; preload
           [vary] => Origin, Accept-Encoding
           [square-version] => 2023-07-20
           [x-content-type-options] => nosniff
           [x-download-options] => noopen
           [x-envoy-decorator-operation] => /v2/catalog/**
           [x-frame-options] => SAMEORIGIN
           [x-permitted-cross-domain-policies] => none
           [x-speleo-traceid] => CDN-648bf5aa-2a2a-476d-ae76-ff49a0a29793
           [x-sq-dc] => aws
           [x-sq-region] => us-west-2
           [x-xss-protection] => 1; mode=block
           [set-cookie] => __cf_bm=LAXNJ6.xF.GbxkRPpI2gk9WC9emYFzNqkg_LR_Csm8Q-1711254906-1.0.1.1-sd60CSo81xk.6MsFbJLjh2vdMfdFklfjedxwK.L9tKGyr0_8F7QExKUWW9nn0yubdOaujLso.iOcwmArbZslLQ; path=/; expires=Sun, 24-Mar-24 05:05:06 GMT; domain=.connect.squareup.com; HttpOnly; Secure; SameSite=None
           [server] => cloudflare
       )
       body: Array
       (
           [0] => Square\Models\Error Object
               (
                   [category:Square\Models\Error:private] => INVALID_REQUEST_ERROR
                   [code:Square\Models\Error:private] => BAD_REQUEST
                   [detail:Square\Models\Error:private] => Expected ItemVariation to have 3 Item Option Values, got 0
                   [field:Square\Models\Error:private] => 
               )
   
       )
        CONTEXT: {"_legacy":true}
       2024-03-24T04:35:06+00:00 NOTICE Failed step cycle: update_matched_products (26.71s) - [BAD_REQUEST] Expected ItemVariation to have 3 Item Option Values, got 0 CONTEXT: {"_legacy":true}
       2024-03-24T04:35:06+00:00 NOTICE [BAD_REQUEST] Expected ItemVariation to have 3 Item Option Values, got 0 CONTEXT: {"_legacy":true}
       ```
   
 *  [Zee](https://wordpress.org/support/users/doublezed2/)
 * (@doublezed2)
 * [2 years ago](https://wordpress.org/support/topic/sync-failed-issue/page/2/#post-17525722)
 * Hello [BalinJFoley](https://wordpress.org/support/users/balinjfoley/)
 * Thank you for your reply.
 * I have reviewed the log you shared and unfortunately, there is no indication 
   of the source. Therefore, it is not possible to tell which product is throwing
   error 400.
 * I suggest checking [Square inventory history](https://squareup.com/help/us/en/article/5228-basic-inventory-management)
   to see which products were updated recently and which were not. Hopefully, the
   product that failed to sync will show an older date than the ones that are synced.
 * Please let me know how you progress 🙂
 * Best regards.
 *  Thread Starter [BalinJFoley](https://wordpress.org/support/users/balinjfoley/)
 * (@balinjfoley)
 * [2 years ago](https://wordpress.org/support/topic/sync-failed-issue/page/2/#post-17527774)
 * Okay I’ll continue checking and replacing each product in Square and once that’s
   done I’ll check back here and update you.
 * Just to be clear this coded issue is definitely related to one of the products
   and not anything else?
 * Thanks
 *  Plugin Support [Shameem – a11n](https://wordpress.org/support/users/shameemreza/)
 * (@shameemreza)
 * [2 years ago](https://wordpress.org/support/topic/sync-failed-issue/page/2/#post-17527795)
 * Hi [@balinjfoley](https://wordpress.org/support/users/balinjfoley/),
 * The error code 400, BAD_REQUEST, usually indicates that the request sent to the
   server is incorrect or corrupted and might be related to the Cloudflare firewall.
 * Please continue with your plan to check and replace each product in Square, paying
   close attention to the item options. Once you’ve done that, please check back
   with us and update us on the situation.
 * Additionally, you can make the same changes to the last product by disabling 
   Cloudflare for a while to see whether this error occurs again or not.
 * I hope this provides some clarity on the matter. If you have any other questions
   or need further assistance, please don’t hesitate to ask.
 *  [anastas10s](https://wordpress.org/support/users/anastas10s/)
 * (@anastas10s)
 * [2 years ago](https://wordpress.org/support/topic/sync-failed-issue/page/2/#post-17553994)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   we’ll be here if and/or when you are ready to continue.

Viewing 5 replies - 16 through 20 (of 20 total)

[←](https://wordpress.org/support/topic/sync-failed-issue/?output_format=md) [1](https://wordpress.org/support/topic/sync-failed-issue/?output_format=md)
2

The topic ‘Sync Failed issue’ 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/)

 * 21 replies
 * 5 participants
 * Last reply from: [anastas10s](https://wordpress.org/support/users/anastas10s/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/sync-failed-issue/page/2/#post-17553994)
 * Status: resolved