Skip to content
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

Uncaught Error Stack Trace #544

Open
unakriti opened this issue Mar 17, 2024 · 52 comments
Open

Uncaught Error Stack Trace #544

unakriti opened this issue Mar 17, 2024 · 52 comments

Comments

@unakriti
Copy link

Hi,

My site has the Razorpay Plugin and the Razorpay Subscriptions Plugin with the folllowing software:

WordPress 6.4.3
Woocommerce version 8.6.1
Woocommerce subscription version 6.0.0
On the Checkout page, the Razorpay payment errors out. There are a few errors in the browser console too. There's also this fatal error on the site - it is related to your plugin. Here's the stack trace information for your attention please

WordPress version 6.4.3
Active theme: Bricks (version 1.9.6.1)
Current plugin: 1 Razorpay: Signup for FREE PG (version 4.6.1)
PHP version 8.2.15

Error Details
An error of type E_ERROR was caused in line 142 of the file /wp-content/plugins/woo-razorpay/includes/razorpay-webhook.php. Error message: Uncaught Error: Call to a member function get_meta() on bool in /wp-content/plugins/woo-razorpay/includes/razorpay-webhook.php:142

Stack trace:
#0 /wp-content/plugins/woo-razorpay/woo-razorpay.php(3008):
RZP_Webhook->process()
razorpay/razorpay-woocommerce-subscriptions#1 /wp-includes/class-wp-hook.php(324): razorpay_webhook_init()
razorpay/razorpay-woocommerce-subscriptions#2 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
razorpay/razorpay-woocommerce-subscriptions#3 /wp-includes/plugin.php(517): WP_Hook->do_action()
razorpay/razorpay-woocommerce-subscriptions#4 /wp-admin/admin-post.php(61): do_action()
razorpay/razorpay-woocommerce-subscriptions#5 {main}
thrown

Lastly, I receive the following webhooks failure notification email from Razorpay

"Hi, We have been experiencing webhook delivery failure for past 24 hours while trying to hit the live webhook url - https://www.domain.com/wp-admin/admin-post.php?action=rzp_wc_webhook. As noted in our documentation, we have disabled your webhook as a precaution. You can re-enable the webhook again by visiting the Dashboard and going to the webhooks tab."

If I manually point my browser to that webhook URL, it triggers the Uncaught Error mentioned above.

Please, can you help resolve these issues?

Kind regards,

@yashgit891
Copy link
Contributor

Hello @unakriti,
Did you enable HPOS and then this error occurred?
Also can you try saving the plugin settings once and let the webhook be automatically updated and check if the issue still persists..

@abdulwahidsharief
Copy link
Contributor

@unakriti please check if woocommerce subscription plugin is active

@unakriti
Copy link
Author

unakriti commented Mar 18, 2024

Thanks for your response.

@abdulwahidsharief Yes, the Woo Subscriptions plugin is active.

@yashgit891 to your questions

  • tried saving the plugin configuration but no change
  • HPOS is enabled - this is the default configuration for new WooCommerce stores these days.

Screenshot 1: HPOS Configuration
Woo HPOS Enabled Configuration Screenshot from 2024-03-18 18-03-34

Screenshot 2: Woo does not recognize Razorpay as a payment gateway capable of processsing automatic subscription payments
Razorpay Woo Not Detected Screenshot from 2024-03-18 17-55-17

Look forward to your advise please.

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti need to look into the message from Screenshot 2. Are there only subscription products in your store, or more specifically is the error that you mentioned above only occurring for subscription orders?

@unakriti
Copy link
Author

@yashgit891 Thanks and yes, I only have Subscription products in the store - Simple Subscriptions and Grouped Products for Simple Subscriptions.

@unakriti
Copy link
Author

Also, in test mode, while UPI works alright, the Netbanking option throws this error on the order page:

Screenshot: "Oops, something went wrong"

Razorpay Sanitized Error Screenshot from 2024-03-18 19-41-26

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti the error that you have mentioned is related to plugins and we will start looking into it. As for the netbanking issue that needs to be reported to the support team by you as it is related to your account.

@yashgit891 yashgit891 added the bug label Mar 19, 2024
@unakriti
Copy link
Author

@yashgit891 thank you so much. Sincerely appreciate it. I will raise the other issue of Netbanking error with Razorpay Support.

PS: Whlie with the plugin, might I request you to kindly consider the following?

At the moment, its not possible to use this Woo Subscription option of "Do not stop until cancelled" because Razorpay does not allow perpetual subscriptions. There are practical issues of managing a subscription with such a limitation. Therefore, could you please consider mapping Woo Subscirption's option of "Do not stop until cancelled" to Razorpay's maximum duration of 99 years? This request is also available here - razorpay/razorpay-woocommerce-subscriptions#74

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti sure we have noted this suggestion and once we have resolved the above issue, will look into this as well.

@yashgit891
Copy link
Contributor

Hello @unakriti, not able to reproduce the error at our end, are there any specific steps that are taken for this error to occur or is this happening for all orders?

@unakriti
Copy link
Author

unakriti commented Mar 19, 2024 via email

@yashgit891
Copy link
Contributor

@unakriti is it possible for you to come on a call with me so that I can check on you website only. If it is possible please email me your availability on yash.tripathi@razorpay.com and I will setup a call accordingly.

@unakriti
Copy link
Author

unakriti commented Mar 19, 2024 via email

@unakriti
Copy link
Author

unakriti commented Mar 21, 2024 via email

@unakriti
Copy link
Author

unakriti commented Mar 21, 2024 via email

@unakriti
Copy link
Author

@yashgit891

Sincerely appreciate your support to resolve this issue with a modified plugin file made available via WeTransfer platform.

Might I request you to kindly create a dev branch for reference, here on Github? It helps to track the version I am using on my website.

Kind regards,

@unakriti
Copy link
Author

@yashgit891

I thought everything was looking okay but there's this browser console error in the WordPress dashboard - it is related to the revised version (downloaded via WeTransfer) of this plugin. Could you advise how to resolve this please? Thanks

Razorpay Revised Plugin Console Error Screenshot from 2024-03-22 19-01-58

Kind regards,

@unakriti
Copy link
Author

@yashgit891 Could you please help with the console error mentioned above?

@yashgit891
Copy link
Contributor

@unakriti looking into the error, but this error should not cause any issues with the normal flow of the plugin, as it is for analytics and not any functionality.

@unakriti
Copy link
Author

@yashgit891 thank you so much for that clarification.

Also, could you please share a link to the dev branch of the plugin version shared via WeTransfer link?

@yashgit891
Copy link
Contributor

@unakriti this is the branch link but it does not have the changes for the conflict functionality that was removed as that error is not general.
https://github.com/razorpay/razorpay-woocommerce/tree/subscription_events_fix

@unakriti
Copy link
Author

@yashgit891 in that case, the next update to the plugin will overwrite the solution you have provided. What's a good way to resolve the issue?

@yashgit891
Copy link
Contributor

@unakriti the only possible way right now is to manually remove that piece of code at the time of update.

@unakriti
Copy link
Author

@yashgit891

Sorry, cann't accept such a solution in production scenarios. Hope you will understand. Practically speaking, in this case, the plugin is broken even before we rollout the first update.

Could you please suggest a robust and stable solution that can survive future plugin updates without manual intervention?

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti We cannot apply this change to our release as it will impact users that require the conflict functionality and it will hamper their flow. That is the only way it can be included in future releases.

@unakriti
Copy link
Author

@yashgit891

I switched to Razorpay with much hope. Request you to please help integrate the scenarios to support all your merchants. Obviously, a manual update to the plugin is not a valid production-scenario - especially since I have a standard WooCommerce deployment.

Perhaps a conditional statement inside the plugin to include / exclude the conflict functionality might help resolve the issue?

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti ,
To support this scenario, first we will need to reproduce the error and then proceed with the design and implementation of a viable solution, which might take some time. I will update on this thread when we have resolved this issue and released a version with the fix.

@yashgit891
Copy link
Contributor

@unakriti the branch that I have shared, is it causing any break in functionality, barring the 500 webhook error? Because even if few webhook requests are returning 500 response but there are 200 responses then flow should not break.

@unakriti
Copy link
Author

@unakriti the branch that I have shared, is it causing any break in functionality, barring the 500 webhook error? Because even if few webhook requests are returning 500 response but there are 200 responses then flow should not break.

Subscription cancellation workflow breaks

@unakriti , To support this scenario, first we will need to reproduce the error and then proceed with the design and implementation of a viable solution, which might take some time. I will update on this thread when we have resolved this issue and released a version with the fix.

Thank you. Look forward to the new version update with a clean solution ready for production sites.

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti subscription cancellation workflow has been fixed in that branch please test once more. And if still error is their share the error, as we have tested the same just now.

@unakriti
Copy link
Author

unakriti commented Mar 27, 2024

@yashgit891

As requested, I tested again with the zip file downloaded from https://github.com/razorpay/razorpay-woocommerce/tree/subscription_events_fix. Hope this is correct?

This time WooCommerce did not detect the Razorpay Subscription plugin. Please see screenshot - it detects only the Razorpay Payment plugin.

Razorpay Subscription Plugin not Detected by Woo Screenshot from 2024-03-27 17-18-43

Edit: As expected, on the Checkout page, there's this message "Sorry, it seems there are no available payment methods which support subscriptions. Please contact us if you require assistance or wish to make alternate arrangements."

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti can you rename the zip file to woo-razorpay.zip and check if Razorpay subscription option is there.

@unakriti
Copy link
Author

I will test the file renaming and update here.

Meanwhile, I noticed that the zip file from WeTransfer is 1.2 MB whereas the GitHub zip is 588 kB - almost half the original file size. Is this difference okay - I hope I am using the correct file?

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti it might be because of the way github compresses the file as compared to our systems. Also please rename the actual folder inside the zip file not just the zip file.

@unakriti
Copy link
Author

Thanks for the clarification.

I renamed the folder and the zip file. However, when I upload and activate the plugin, it crashed my site (WordPress' white screen of death) whlie causing a conflict with the Litespeed Cache plugin (version 6.1). Error was caught at https://www dot domain dot com/wp-admin/plugins.php?action=activate&plugin=woo-razorpay%2Fwoo-razorpay.php&_wpnonce=448748t8ge

But if I then go to the plugins page and Activate the new Razorpay plugin, it works okay.

The webhook status for subscription.charged event and the subscription.cancelled event is 200 but the status of other webhook events shows as 409. Not sure whether the 409s will again force Razorpay to disable the webhook.

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti no the 409s are expected and they will not cause any issues.Not sure of the first part though it maybe because of zip installation. Please observe if any errors occur in flow now.

@unakriti
Copy link
Author

unakriti commented Mar 27, 2024 via email

@yashgit891
Copy link
Contributor

@unakriti yes this supports automatic updates.

@unakriti
Copy link
Author

unakriti commented Mar 28, 2024

Many thanks for that confirmation.

Lastly, to fully support Woo Subscriptions, could you please consider the following features at the soonest possible:

  1. support for perpetual subscriptions (map to 99 years inside Razorpay) and
  2. Automatic renewal (renewal without requiring a customer login at the time of renewal)
  3. Support more than one product in the Woo cart if one of the products is a subscription

This should help many businesses to transition to Razorpay.

Kind regards,

@unakriti
Copy link
Author

unakriti commented Apr 4, 2024

@yashgit891

The plugin makes the site unstable. The issue we discussed on this thread is persisting even after updating to the new version of the Razorpay plugin. The only other change is updating to WordPress to version 6.5. All else remains the same.

Here are the details as below:

WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, 1 Razorpay: Signup for FREE PG.

First, visit your website (https://www.domain.com/) and check for any visible issues. Next, visit the page where the error was caught (https://www.domain.com/wp-admin/admin-post.php?action=rzp_wc_webhook) and check for any visible issues.

Please contact your host for assistance with investigating this issue further.

If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.

https://www.domain.com/wp-login.php?action=enter_recovery_mode&rm_token=DE39vfLOUZD6hH16n8eVgH&rm_key=8tP3lpnDgGHIb8AOPPzQ4g

To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.5
Active theme: Bricks (version 1.9.7.1)
Current plugin: 1 Razorpay: Signup for FREE PG (version 4.6.2)
PHP version 8.2.15

Error Details

An error of type E_ERROR was caused in line 158 of the file /wp-content/plugins/woo-razorpay/includes/razorpay-webhook.php. Error message: Uncaught Error: Call to a member function get_meta() on bool in /wp-content/plugins/woo-razorpay/includes/razorpay-webhook.php:158

Stack trace:
#0 /wp-content/plugins/woo-razorpay/woo-razorpay.php(3023): RZP_Webhook->process()
#1 /wp-includes/class-wp-hook.php(324): razorpay_webhook_init()
#2 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#3 /wp-includes/plugin.php(517): WP_Hook->do_action()
#4 /wp-admin/admin-post.php(61): do_action()
#5 {main}
thrown

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti can you try upgrading to the latest version that was released after I provided you the zip file and check.

@unakriti
Copy link
Author

unakriti commented Apr 4, 2024

@yashgit891

Thank you . you'd notice from the error trace above, the plugin version is the latest - it was auto updated

Current plugin: 1 Razorpay: Signup for FREE PG (version 4.6.2)

Kind regards,

@yashgit891
Copy link
Contributor

@unakriti is wc_orders and wc_orders_meta table created for you in the database?

@unakriti
Copy link
Author

unakriti commented Apr 9, 2024

@yashgit891 sorry for the delay to respond.

Yes, it is a standard WooCommerce deployment.

@abdulwahidsharief
Copy link
Contributor

@unakriti can you please provide staging site access to abdul.sharief@razorpay.com

@unakriti
Copy link
Author

@yashgit891 and @abdulwahidsharief

I've setup a staging version, verified that the issue has been reproduced for you to review and troubleshoot, and shared the admin access information with both of you via email.

Look forward to your help and guidance to resolve this please.

@unakriti
Copy link
Author

@abdulwahidsharief

Hope the site access is now available and you are able to login and review the issue.

Look forward to read an update from you. Appreciate the support

Kind regards,

@abdulwahidsharief
Copy link
Contributor

@unakriti
placed a few orders but unable to reproduce the issue. i have added extra logs in plugins and uploaded them on site to debug
please help us with logs when ever error occurs

@unakriti
Copy link
Author

@abdulwahidsharief

Has there been a recent update to the Razorpay Subscriptions for WooCommerce plugin ? I noticed verion 2.3.9 on the staging site and also noticed "Added WC_Subscriptions_Cart check" note on the WP Repo. See screenshot below.

Woo RZP Subscription Plugin Updated to V239 Screenshot from 2024-04-15 19-52-42

With Razorpay Subscriptions for WooCommerce plugin version 2.3.9, I retried the transactions of placing and cancelling an order via my site. I did not notice any fatal errors in my site. Also, on the Razorpay dashboard, it took three 409 (http statuses) before seeing a 200 (green, OK) payment.authorized status. Overall the transactions went through without causing fatal errors / crashing my site.

The Razorpay Subscriptions for WooCommerce plugin version 2.3.9 is not available yet for auto-upgrade because on the WP Repo (as you'd notice above screenshot), it still says version 2.3.8. Perhaps it is an oversight?

Kind regards,

@abdulwahidsharief
Copy link
Contributor

@unakriti 2.3.8 is version label which wasn't updated it will be fixed in next release. and 409 status is we are waiting for sometime for callback to execute first

@unakriti
Copy link
Author

unakriti commented Apr 16, 2024 via email

@unakriti
Copy link
Author

unakriti commented May 9, 2024

Sorry to persist but the issue has resurfaced and I request your support to resolve this please.

Here's the latest recovery email containing the stack trace for your reference

Howdy!

WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, 1 Razorpay: Signup for FREE PG.

First, visit your website (https://sub.domain.tld/) and check for any visible issues. Next, visit the page where the error was caught (https://sub.domain.tld/wp-admin/admin-post.php?action=rzp_wc_webhook) and check for any visible issues.

Please contact your host for assistance with investigating this issue further.

If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.

https://sub.domain.tld/wp-login.php?action=enter_recovery_mode&rm_token=MASKEDMASKED&rm_key=MASKEDMASKED

To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.5.3
Active theme: Bricks Child Theme (version 1.1)
Current plugin: 1 Razorpay: Signup for FREE PG (version 4.6.4)
PHP version 8.2.15

Error Details

An error of type E_ERROR was caused in line 158 of the file /var/sub/domain.tld/html/wp-content/plugins/woo-razorpay/includes/razorpay-webhook.php. Error message: Uncaught Error: Call to a member function get_meta() on bool in /var/sub/domain.tld/html/wp-content/plugins/woo-razorpay/includes/razorpay-webhook.php:158
Stack trace:
#0 /var/sub/domain.tld/html/wp-content/plugins/woo-razorpay/woo-razorpay.php(2992): RZP_Webhook->process()
#1 /var/sub/domain.tld/html/wp-includes/class-wp-hook.php(324): razorpay_webhook_init()
#2 /var/sub/domain.tld/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#3 /var/sub/domain.tld/html/wp-includes/plugin.php(517): WP_Hook->do_action()
#4 /var/sub/domain.tld/html/wp-admin/admin-post.php(61): do_action()
#5 {main}
thrown

Kind regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants