• Resolved BalinJFoley

    (@balinjfoley)


    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)
  • Thread Starter BalinJFoley

    (@balinjfoley)

    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}
    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello 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 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

    (@balinjfoley)

    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 R. a11n

    (@shameemreza)

    Hi @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.

    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)
  • The topic ‘Sync Failed issue’ is closed to new replies.