razorpay / razorpay-magento

Razorpay Payment Extension for Magento
28 stars 39 forks source link

Column not found: 1054 Unknown column 'main_table.rzp_webhook_notified_at #487

Closed ashok1421 closed 2 months ago

ashok1421 commented 3 months ago

Hello, I am using the Razor pay module version 4.1.4 I found the error in my exception.log file. main.CRITICAL: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.rzp_webhook_notified_at' in 'field list', query was: SELECTmain_table.entity_id,main_table.rzp_webhook_notified_atFROMsales_orderASmain_tableWHERE (increment_id='2425000000005') {"report_id":"c966397c15ac157f1dbea0d8da72812c815f1ac101154b95b84ed64d41f47344","exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.rzp_webhook_notified_at' in 'field list', query was: SELECTmain_table.entity_id,main_table.rzp_webhook_notified_atFROMsales_orderASmain_tableWHERE (increment_id='2425000000005') at /usr/local/lsws/svaraa/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:110, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.rzp_webhook_notified_at' in 'field list' at /usr/local/lsws/svaraa/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:91)"} [] Please check this issue. Here used rzp_webhook_notified_at in protected function getOrderWebhookData($orderId) : array

Screenshot 2024-05-13 at 5 32 14 PM

Please check the attached file. Thank You.

sanganinamrata commented 3 months ago

Hello @razorpay-sanjib & team,

I'm also facing the same issue after the latest upgrade. My 4 live clients were already using this module & after the upgrade, their webhooks got broken due to this error.

Any urgent help would be appreciated.

Thanks in advance.

yashgit891 commented 3 months ago

@ashok1421 can you the schema of razorpay_sales_order table and check if these columns are present there?

ashok1421 commented 3 months ago

Yes In the razorpay_sales_order table columns rzp_webhook_notified_at are present.

yashgit891 commented 3 months ago

@ashok1421 okay and what is the prx in the query? Is this some other module as it does not look Razorpay related.

ashok1421 commented 3 months ago

@yashgit891 "prx" is only table prefix of my local project. The issue is rzp_webhook_notified_at columns filter in sales_order table so this error occrud

yashgit891 commented 3 months ago

@ashok1421 identified the bug here, will provide a solution for the same in the next release.Sorry for the inconvenience.

ashok1421 commented 3 months ago

@yashgit891 Thank you

ashok1421 commented 3 months ago

Hello @yashgit891 , Here I solved the issue So please check the solutions. I Attached the patch here. webhook.patch

sanganinamrata commented 3 months ago

Hello @ashok1421,

Thank you! Your provided patch worked for me.

@yashgit891 Will you please check the patch given by @ashok1421 & test it, if all is well, let's merge it on the current repo & make it an official release.

Thanks.

ashok1421 commented 3 months ago

Hello @yashgit891 , can you please tell me Any update on this issue ?

yashgit891 commented 3 months ago

@ashok1421 we have implemented a fix but release might take time. In the meantime you can use this PR as a fix .

yashgit891 commented 2 months ago

This bug has been resolved in latest release.