• Resolved mrtoddkennedy

    (@mrtoddkennedy)


    Recently in the last couple of weeks starting to see “Sync failed. Please try again” with Woocommerce Square syncing.

    SKUs are all set. Woocommerce is set to be product of record.

    When I update inventory numbers in Square, I can pull them into Woocommerce. But when I add new products in Woocommerce, they are no longer being sent to Square.

    I am seeing this error.

    Looking for ideas on where to look? Have had this site running for a number of years, have all the most recent updates.

    2020-01-23T04:19:19+00:00 CRITICAL Uncaught WC_Data_Exception: External products cannot be stock managed. in /var/www/wptbox/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php:810
    Stack trace:
    #0 /var/www/wptbox/wp-content/plugins/woocommerce/includes/class-wc-product-external.php(105): WC_Data->error(‘product_externa…’, ‘External produc…’)
    #1 /var/www/wptbox/wp-content/plugins/woocommerce-square/includes/Sync/Manual_Synchronization.php(1525): WC_Product_External->set_manage_stock(true)
    #2 /var/www/wptbox/wp-content/plugins/woocommerce-square/includes/Sync/Stepped_Job.php(114): WooCommerce\Square\Sync\Manual_Synchronization->pull_inventory()
    #3 /var/www/wptbox/wp-content/plugins/woocommerce-square/includes/Sync/Stepped_Job.php(55): WooCommerce\Square\Sync\Stepped_Job->do_next_step()
    #4 /var/www/wptbox/wp-content/plugins/woocommerce-square/includes/Handlers/Background_Job.php(172): WooCommerce\Square\Sync\Stepped_Job->run()
    #5 /var/www/wptbox/wp-content/plugins/woocommerce-square/includes/Handlers/Background_Job.php(123) in /var/www/wptbox/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php on line 810

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there @mrtoddkennedy,

    I’m sorry to hear that you’re having issues with Square sync!

    The error is actually coming from WooCommerce core plugin:

    https://github.com/woocommerce/woocommerce/blob/d0491072e8a7d0a4535db0ec2bae4a6d43ff64fd/includes/class-wc-product-external.php#L105

    https://github.com/woocommerce/woocommerce/blob/d0491072e8a7d0a4535db0ec2bae4a6d43ff64fd/includes/class-wc-product-external.php#L120

    And it appears when stock is managed for an External/Affiliate product (while it shouldn’t be).

    Square doesn’t sync External/Affiliate products but it seems that it sees stock for External products and throw an error so I’m wondering where it can be coming from:

    – Do you have any External/Affiliate products on your site?
    – If yes, could you please check the following for them in your WP database:

    1) In wp_postmeta table they should have the following meta_keys and meta_values:

    _stock_status = instock
    _manage_stock = no
    _stock = NULL

    stock properties
    Link to image: https://d.pr/i/Bkrma1

    2) In wp_wc_product_meta_lookup:

    stock_quantity = NULL
    stock_status = instock

    stock properties
    Link to image: https://d.pr/i/SEkt7s

    – Do you have any plugins which would have control or anyhow affect stock for WooCommerce products?

    – Do you have any plugins which would affect/create/control External/Affiliate products?

    Also, could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status.
    Select “Get system report” and then “Copy for support”.? Once you’ve done that, paste it here in your response.

    Cheers!

    Thread Starter mrtoddkennedy

    (@mrtoddkennedy)

    Thank you! We do not have any external or affiliate products. Although perhaps it is possible I fat-fingered a product entry and selected external or affiliate. Is there a way I could search to find which products have been set that way?

    The only plug-ins I use that would affect/create/control External/Affiliate products would possibly be Square. We try to run as lean as as possible with minimal plug-ins.

    Thank you for your help thus far in solving this mystery!

    Here is a copy of my System Status:

    
    ### WordPress Environment ###
    
    WordPress address (URL): https://jkdiscs.com
    Site address (URL): https://jkdiscs.com
    WC Version: 3.9.0
    REST API Version: ? 1.0.6
    Log Directory Writable: ?
    WP Version: 5.3.2
    WP Multisite: –
    WP Memory Limit: 128 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    External object cache: ?
    
    ### Server Environment ###
    
    Server Info: nginx/1.14.2
    PHP Version: 7.3.0
    PHP Post Max Size: 512 MB
    PHP Time Limit: 300
    PHP Max Input Vars: 3000
    cURL Version: 7.61.1
    LibreSSL/2.0.0
    
    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.1.32-MariaDB
    Max Upload Size: 512 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 3.9.0
    WC Database Prefix: wp_
    Total Database Size: 21.65MB
    Database Data Size: 13.90MB
    Database Index Size: 7.75MB
    wp_woocommerce_sessions: Data: 3.02MB + Index: 0.08MB + Engine InnoDB
    wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_order_itemmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_comments: Data: 0.33MB + Index: 0.50MB + Engine InnoDB
    wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_options: Data: 1.44MB + Index: 0.08MB + Engine InnoDB
    wp_postmeta: Data: 4.52MB + Index: 5.03MB + Engine InnoDB
    wp_posts: Data: 3.52MB + Index: 0.80MB + Engine InnoDB
    wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_term_relationships: Data: 0.16MB + Index: 0.09MB + Engine InnoDB
    wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_usermeta: Data: 0.09MB + Index: 0.09MB + Engine InnoDB
    wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_vtprd_purchase_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_vtprd_purchase_log_product: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_vtprd_purchase_log_product_rule: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_product_meta_lookup: Data: 0.11MB + Index: 0.19MB + Engine InnoDB
    wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wpfm_backup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    
    ### Post Type Counts ###
    
    amn_mi-lite: 2
    attachment: 768
    customize_changeset: 8
    feedback: 1
    jetpack_migration: 2
    jp_img_sitemap: 2
    jp_sitemap: 2
    jp_sitemap_master: 2
    nav_menu_item: 6
    page: 20
    post: 34
    product: 356
    product_variation: 506
    revision: 260
    scheduled-action: 1814
    shop_coupon: 2
    shop_order: 15
    vtprd-rule: 1
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ?
    
    ### Active Plugins (14) ###
    
    All In One SEO Pack: by Michael Torbert – 3.3.4
    Classic Editor: by WordPress Contributors – 1.5
    Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 7.10.3
    HootKit: by wphoot – 1.0.16
    Jetpack by WordPress.com: by Automattic – 8.1
    VarkTech Pricing Deals for WooCommerce: by Vark – 2.0.1.1 – Not tested with the active version of WooCommerce
    Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.2
    Easy Updates Manager: by Easy Updates Manager Team – 9.0.1
    Title Toggle for Storefront Theme: by Wooassist – 1.2.4
    WooCommerce Services: by Automattic – 1.22.3
    WooCommerce Canada Post Shipping: by WooCommerce – 2.5.12
    WooCommerce Square: by WooCommerce – 2.0.8 – Not tested with the active version of WooCommerce
    WooCommerce: by Automattic – 3.9.0
    WP File Manager: by mndpsingh287 – 5.7
    
    ### Inactive Plugins (7) ###
    
    Akismet Anti-Spam: by Automattic – 4.1.3
    Breadcrumb NavXT: by John Havlik – 6.4.0
    Hello Dolly: by Matt Mullenweg – 1.7.2
    StoreOne Extension: by ThemeFarmer – 2.1.1
    Woo Attributes Coupon: by Gaurav Nagpal – 2.2.0 – Not tested with the active version of WooCommerce
    WooCommerce Admin: by WooCommerce – 0.24.0 – Not tested with the active version of WooCommerce
    WooCommerce PayPal Checkout Gateway: by WooCommerce – 1.6.18 – Not tested with the active version of WooCommerce
    
    ### Dropin Plugins (1) ###
    
    object-cache.php: Redis Object Cache Drop-In
    
    ### Must Use Plugins (1) ###
    
    EasyWP Plugin: by Namecheap
    Inc. – 0.4.8
    
    ### Settings ###
    
    API Enabled: ?
    Force SSL: ?
    Currency: CAD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: ?
    
    ### WC Pages ###
    
    Shop base: #2979 - /shop/
    Cart: #15 - /cart/
    Checkout: #17 - /checkout/
    My account: #19 - /my-account/
    Terms and conditions: ? Page not set
    
    ### Theme ###
    
    Name: Hoot Business
    Version: 2.8.6
    Author URL: https://wphoot.com/
    Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: hoot-business/woocommerce/archive-product.php
    hoot-business/woocommerce/single-product.php
    
    ### Square ###
    
    Environment: Production
    Tokenization Enabled: –
    Debug Mode: Off
    
    ### Action Scheduler ###
    
    Complete: 1,810
    Oldest: 2019-12-23 07:34:10 -0700
    Newest: 2020-01-23 06:44:33 -0700
    
    Pending: 3
    Oldest: 2020-01-23 07:44:32 -0700
    Newest: 2020-01-27 21:34:19 -0700
    
    Canceled: 1
    Oldest: 2020-01-22 22:23:35 -0700
    Newest: 2020-01-22 22:23:35 -0700
    
    In-progress: 0
    Oldest: –
    Newest: –
    
    Failed: 0
    Oldest: –
    Newest: –
    
    
    Thread Starter mrtoddkennedy

    (@mrtoddkennedy)

    I did find one external/affiliate product. It was intended as a pre-release, and apparently I forgot to turn it back into a simple product. I’ve set it back, and will test sync.

    Todd

    Thread Starter mrtoddkennedy

    (@mrtoddkennedy)

    Okay, so although things seem to be working, I’m still getting “Sync failed. Please try again”

    Do you have any suggestions?

    Thank you!

    Todd

    Hi there @mrtoddkennedy,

    Okay, so although things seem to be working, I’m still getting “Sync failed. Please try again”

    Interesting! If you enable Square debug logging in WooCommerce > Settings > Square and initiate another sync, do you see any errors in WooCommerce > Status > Logs > choose the latest square logfile from the drop-down?

    Also, is the fatal error gone now?

    Thread Starter mrtoddkennedy

    (@mrtoddkennedy)

    The fatal error is gone now, thank you!

    And just initiated a full sync and all was successful. It appears things are great! Thank you for your help!

    Hi there @mrtoddkennedy,

    You’re very welcome, I’m glad that the issue has been resolved.

    By the way, I created an external product on my test site with Square extension active, and just having it on my site didn’t break product sync from WC to Square, so something was broken/corrupted within that product of yours.

    Anyways, hope you had a fantastic weekend ?? And thank you for marking the thread as Resolved!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Struggling with Woocommerce Square Sync’ is closed to new replies.