I have a system that generates quotes, then submits the quotes, which processes a payment. The system is pretty standard: nothing really complicated is going on. The quotes have a single product in them.
After the payment is processed, Magento saves the Order and the payment. However, sometimes we get an exception:
PDOException: SQLSTATE: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (
SALES_ORDER_ADDRESS_PARENT_ID_SALES_ORDER_ENTITY_IDFOREIGN KEY (
entity_id) ON DELETE CASCADE) in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228
This error suggests to me that it is trying to save the sales_order_address for a non-existent sales_order record, but why would that happen?
The payment was processed successfully on the backend but there is nothing recorded in the database to indicate that. Retrying the same quote again with the same input data usually results in success – the error appears to be transient.
How can I figure out what is causing the sales_order record to be deleted? How is this even possible? I tried searching the Magento code for a transaction rollback that swallows an exception, but didn’t find any. We are using a third-party Stripe payment module but the order-saving part happens after the payment was successfully placed. From what I can see whatever error is happening here is entirely in the core code. The error is happening on the latest (2.1.11) version.
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!