Hello, I am facing an issue with PayPal express.
Displayed Error on PayPal Express Review Page:
"Can't place the order".
Steps to reproduce:
1. Customer adds product to cart
2. Customer checks out using "PayPal Express" button
3. Customer logs in via PayPal express prompt
4. Customer is redirected to the PayPal Express Review Page
5. Upon pressing the "Confirm Order" button the error is displayed "Can't place the order" is displayed.
Additional information:
1. The customer is NOT redirected to the success page
2. The customer is charged & the order is created correctly within Magento 2.
3. If the customer presses the "Confirm Order" again - it will create a 2nd order BUT it will not charge the customer.
4. In Magento system log, I am given the error:
main.CRITICAL: Exception message: An exception occurred on 'sales_model_service_quote_submit_failure' event: No such entity with id = 2
5. This only happens to older products, when testing with newly created products this issue is not present.
6. This error started occurring after upgrade from Magento 2.3.6 to 2.4.1
Does anyone have any idea on what can be causing this or have any idea how to debug or fix this?
Solved! Go to Solution.
I've spent days with this issue. In the end, what fixed it was disabling flat catalog tables that resolved the issue.
To give some context, we had very similar conditions to your own. We began a migration from 1.9 several months ago and so we've been working on M2 2.3.4. Our environment uses Litespeed and Redis on Plesk. It took a while to rule these out. We noticed that Paypal orders would be placed successfully when using an older copy of the database but not on our most recent copy.
We used the MariaDB general log to monitor queries and found the entity ID error matched a query for categories from the flat table for store 15 (on a multi store environment). The query was identical on both old and new databases which led me to believe we were dealing with a key constraint or corruption. Unfortunately, in a migration of a site with tens of thousands of orders, manually cleaning the db is not an option. When I saw that it's now recommended to bin flat catalog tables I thought we'd give that a try - thinking that if we could bypass that query entirely, we might be able to move past it.
Does anyone have any suggestions on this?
I've spent days with this issue. In the end, what fixed it was disabling flat catalog tables that resolved the issue.
To give some context, we had very similar conditions to your own. We began a migration from 1.9 several months ago and so we've been working on M2 2.3.4. Our environment uses Litespeed and Redis on Plesk. It took a while to rule these out. We noticed that Paypal orders would be placed successfully when using an older copy of the database but not on our most recent copy.
We used the MariaDB general log to monitor queries and found the entity ID error matched a query for categories from the flat table for store 15 (on a multi store environment). The query was identical on both old and new databases which led me to believe we were dealing with a key constraint or corruption. Unfortunately, in a migration of a site with tens of thousands of orders, manually cleaning the db is not an option. When I saw that it's now recommended to bin flat catalog tables I thought we'd give that a try - thinking that if we could bypass that query entirely, we might be able to move past it.
Thank you, life saver.
This is the issue here.
Very-2 thanks for a lot of time saving.