Error when viewing out of stock products
-
I am getting a critical error page when trying to view any product that is out of stock from the front end. If I disable the plugin the page is viewable again.
The page I need help with: [log in to see the link]
-
Hi there,
Thank you for reaching out and I’m sorry to hear about critical errors on your site.
“Critical error” message is not very descriptive and does not specify what exactly is happening on your site.
Can you please head to WooCommerce >> Status >> Logs, find a fatal error log timestamped around the time you’ve seen this error on the front end, copy the entire log (or just the relevant parts) and paste it here?
You may want to make sure the log doesn’t contain any sensitive information such as user details first, although most likely there won’t be any sensitive information.
Thank you!
This is what I found. It’s really long. I’m not a coder so I’m not sure what is relevant. Thanks for any help you can give!
02-09-2021 @ 18:35:29 - Starting step cycle: update_inventory_counts 02-09-2021 @ 18:35:29 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.2 (WooCommerce/4.9.2; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-09T23:29:31+00:00" } duration: 0.12887s 02-09-2021 @ 18:35:29 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 00:35:29 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-09-2021 @ 18:35:29 - Completed job step: update_inventory_counts 02-09-2021 @ 18:35:31 - Completed step cycle: update_inventory_counts (2.16s) 02-09-2021 @ 19:38:24 - Starting step cycle: update_inventory_counts 02-09-2021 @ 19:38:25 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.2 (WooCommerce/4.9.2; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-10T00:35:29+00:00" } duration: 0.1361s 02-09-2021 @ 19:38:25 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 01:38:25 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-09-2021 @ 19:38:25 - Completed job step: update_inventory_counts 02-09-2021 @ 19:38:25 - Completed step cycle: update_inventory_counts (0.27s) 02-09-2021 @ 20:41:06 - Starting step cycle: update_inventory_counts 02-09-2021 @ 20:41:06 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.2 (WooCommerce/4.9.2; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-10T01:38:25+00:00" } duration: 0.12442s 02-09-2021 @ 20:41:06 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 02:41:06 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-09-2021 @ 20:41:06 - Completed job step: update_inventory_counts 02-09-2021 @ 20:41:06 - Completed step cycle: update_inventory_counts (0.27s) 02-09-2021 @ 21:43:59 - Starting step cycle: update_inventory_counts 02-09-2021 @ 21:43:59 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.2 (WooCommerce/4.9.2; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-10T02:41:06+00:00" } duration: 0.36466s 02-09-2021 @ 21:43:59 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 03:43:59 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-09-2021 @ 21:43:59 - Completed job step: update_inventory_counts 02-09-2021 @ 21:43:59 - Completed step cycle: update_inventory_counts (0.51s) 02-09-2021 @ 22:46:35 - Starting step cycle: update_inventory_counts 02-09-2021 @ 22:46:35 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.2 (WooCommerce/4.9.2; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-10T03:43:59+00:00" } duration: 0.11569s 02-09-2021 @ 22:46:35 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 04:46:35 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-09-2021 @ 22:46:35 - Completed job step: update_inventory_counts 02-09-2021 @ 22:46:35 - Completed step cycle: update_inventory_counts (0.13s) 02-09-2021 @ 23:49:18 - Starting step cycle: update_inventory_counts 02-09-2021 @ 23:49:18 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.2 (WooCommerce/4.9.2; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-10T04:46:35+00:00" } duration: 0.11267s 02-09-2021 @ 23:49:18 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 05:49:18 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-09-2021 @ 23:49:18 - Completed job step: update_inventory_counts 02-09-2021 @ 23:49:18 - Completed step cycle: update_inventory_counts (0.14s) 02-10-2021 @ 01:54:19 - Starting step cycle: update_inventory_counts 02-10-2021 @ 01:54:20 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.3 (WooCommerce/5.0.0; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-10T05:49:18+00:00" } duration: 0.13784s 02-10-2021 @ 01:54:20 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 07:54:20 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-10-2021 @ 01:54:20 - Completed job step: update_inventory_counts 02-10-2021 @ 01:54:20 - Completed step cycle: update_inventory_counts (0.52s) 02-10-2021 @ 02:54:30 - Starting step cycle: update_inventory_counts 02-10-2021 @ 02:54:31 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.3 (WooCommerce/5.0.0; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-10T07:54:20+00:00" } duration: 0.12685s 02-10-2021 @ 02:54:31 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 08:54:31 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-10-2021 @ 02:54:31 - Completed job step: update_inventory_counts 02-10-2021 @ 02:54:31 - Completed step cycle: update_inventory_counts (0.43s) 02-10-2021 @ 03:55:21 - Starting step cycle: update_inventory_counts 02-10-2021 @ 03:55:22 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.3 (WooCommerce/5.0.0; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-10T08:54:31+00:00" } duration: 0.3619s 02-10-2021 @ 03:55:22 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 09:55:22 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-10-2021 @ 03:55:22 - Completed job step: update_inventory_counts 02-10-2021 @ 03:55:22 - Completed step cycle: update_inventory_counts (0.63s) 02-10-2021 @ 04:55:22 - Starting step cycle: update_inventory_counts 02-10-2021 @ 04:55:23 - Request Request method: uri: batchRetrieveInventoryCountsWithHttpInfo user-agent: WooCommerce-Square/2.3.3 (WooCommerce/5.0.0; WordPress/5.6.1) headers: Array ( ) body: { "location_ids": [ "S5TEP2B9RDGQR" ], "updated_after": "2021-02-10T09:55:22+00:00" } duration: 0.42187s 02-10-2021 @ 04:55:23 - Response Response code: 200 message: headers: Array ( [0] => HTTP/2 200 [content-type] => application/json [square-version] => 2019-08-14 [vary] => Origin, Accept-Encoding [x-content-type-options] => nosniff [x-download-options] => noopen [x-frame-options] => SAMEORIGIN [x-permitted-cross-domain-policies] => none [x-xss-protection] => 1; mode=block [date] => Wed, 10 Feb 2021 10:55:23 GMT [content-length] => 2 [strict-transport-security] => max-age=631152000; includeSubDomains; preload ) body: {} 02-10-2021 @ 04:55:23 - Completed job step: update_inventory_counts 02-10-2021 @ 04:55:23 - Completed step cycle: update_inventory_counts (0.61s)
Same issue here on a few sites. Here’s the PHP error:
"PHP message: PHP Fatal error: Uncaught Exception: You cannot add that amount of "Lady Dye Yarns Winterpalooza Box"; to the cart because there is not enough stock (0 remaining). in /public/wp-content/plugins/woocommerce-square/includes/Gateway/Digital_Wallet.php:284 Stack trace: #0 /public/wp-content/plugins/woocommerce-square/includes/Gateway/Digital_Wallet.php(233): WooCommerce\Square\Gateway\Digital_Wallet->get_product_payment_request(11136) #1 /public/wp-content/plugins/woocommerce-square/includes/Gateway/Digital_Wallet.php(202): WooCommerce\Square\Gateway\Digital_Wallet->get_payment_request_for_context('product') #2 /public/wp-includes/class-wp-hook.php(287): WooCommerce\Square\Gateway\Digital_Wallet->enqueue_scripts('') #3 /public/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #4 /public/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #" while reading response header from upstream, client: ---, server: ---, request: "GET /product/lady-dye-yarns-winterpalooza-box/ HTTP/1.0", host: "ladydyeyarns.com", referrer: "https://ladydyeyarns.com/product-category/limited-products/"
Hi there!
I could replicate the same error with Digital Wallet enabled. Unchecking the option fixes the error, but also disables the digital wallet (expected behavior).
I’ve flagged this to the developers for now. Please keep an eye out for the fix in the changelogs: https://www.ads-software.com/plugins/woocommerce-square/#developers
Thank you for your understanding.
Hi there!
Just a heads up that this is now fixed and the patch released as a new update (2.3.4).
I’ll mark this topic as solved for now. Please feel free to open a new topic if you’re still having trouble with this after updating.
Thank you! It works!
- The topic ‘Error when viewing out of stock products’ is closed to new replies.