-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebHooks are failing to complete some order but not all. #30
Comments
Can you give me the WP, WooCommerce version you are using please. Also when you say "not all" - is there a pattern? are some orders subscriptions for example? |
Also ensure you have debug enabled and check logs- see wiki |
WordPress 5.8.1 All of my products are Subscription Products (Variations Subscription) Some orders don't complete automatically. For new orders, order status doesn't change from Pending Payment to Completed. For Subscription renewal, the Subscription status changed to On-Hold and the renewal order status doesn't change from Pending Payment to Completed. |
Hmm I haven't tested it on later versions so that could be an issue. Ensure the log recording is on in settings and see what FS says - looks like it may not be finding the order. The first "notice" you recorded is suspicious as it seems to indicate that it's not able to record the reference which is something FS provides on initial purchase so that the webhook can find the order later once paid. I would suggest disabling as much as possible to see if you can eliminate the initial error messages if your log does show FS calling but saying it cannot find order. You can provide some of the relevant log parts here too if desired. |
I'm also having this issue, although I haven't seen the errors shown above. There is no obvious pattern to which orders fail in my case, but I do know that the webhook information provided by Fastspring shows that it's failing with a 503 error.
What could potentially be causing it to become temporarily unavailable? Any help you could provide would be wonderful, I'm getting more and more incomplete orders all the time and having to manually approve them. This used to be very occasional but now it's nearly a daily thing. |
a 503 would indicate a potential slow response from your website. This could happen if you have too many orders (slow db), not running on an optimized server, a timeout somewhere... Not sure if this would show in your error log but Id be sure to turn debug and error tracking on. (https://kinsta.com/blog/http-error-503/ might help). Unfortunately there can be so many culprits so it's a matter of trial and error. Perhaps you can make another deploy without any extra plugins/theme that targets same database for the sake of FS? Might allow you to debug better. I've definitely seen Woo issues when too many orders in DB so purging old ones can help. |
Ok, I did as you suggested and tried removing cancelled orders, and have been watching the situation since. It definitely was the culprit. For a short time, I had absolutely no issues whatsoever, but now, as orders increase again, the problem is returning. I can't delete any completed orders because I have a library of digital products. Is my only option to change hosts? If so, how would I know which ones might avoid the problem? I only have like 400 orders so it's a joke to have "too many" at this stage... Thank you for your help. I know it isn't exactly related to the plugin now but any direction would be very much appreciated. |
Ya 400 is nothing. When I saw issues like that it was around 50-100K. Id ensure your timeout is longer (i.e. https://tommcfarlin.com/resolving-php-timeouts-wordpress/) which you may or may not be able to change on your host. But I suspect there is a slow plugin/theme issue here. There is a plugin called Query Monitor which helps find slow DB calls and using the web inspector of the browser to see if there are slow loading assets. Things like social plugins can make a site super slow as they sometimes wait to make a call to their server - if you have stuff that loads after that its going to take forever. Try disabling all non essential plugins or theme features. Personally I would not use anything but WPEngine for hosting. |
Here you go: https://querymonitor.com/docs/ - while the idea way would be to replicate the exact call that FS does (which is possible but complex) I think this could give you insight. Since the FS call will cause Woo to search for an order and update it you may try the QM in a site area that has Woo doing something - could be the admin order search, the user account panel etc - hopefully that will help. |
Notice: Trying to access array offset on value of type null in /var/www/html/wp-content/plugins/woocommerce-fastspring-payment-gateway-master/woocommerce-gateway-fastspring.php on line 378
Notice: Undefined property: stdClass::$reference in /var/www/html/wp-content/plugins/woocommerce-fastspring-payment-gateway-master/includes/class-wc-gateway-fastspring-handler.php on line 288
The text was updated successfully, but these errors were encountered: