6

I have missing orders in Magento which were actually paid for without confirmation, nor an email and are absent in Magento back-end.

As a test I place an order and I don't see anything going on the last point of checkout. I think that something went wrong.

I check my store for new orders I check my emails but nothing. So naturally I place the order again as I think it wasn't processed. Second time it went through fine. Later I see on PayPal that I actually placed 2 orders and charged for two orders.

The database doesn't show the two only the second one. However in PayPal there are two order numbers (e.g. 1777587 and 1777588) and in the database just one (e.g. 1777588). Obviously the number is being generated by Magento given to PayPal to process but not being saved. Weird!

However it doesn't happen every time to every one but it happens 15% of the times lately. Thats not good people get charged twice or I lose orders.

3 Answers 3

3

The MYSQL error is more a symptom of another issue, than the cause.

In your question you mention that you get a 'long page load' -> this is the real reason for your issues, and then results in the MYSQL has gone away error.

What you need to diagnose is that long delay. What is causing it? It can be a multitude of things.

As an example, on a site I manage, I had exactly the same issues. The end result was that a 3rd party module was syncing orders with an external system using the sales_order_place_after method, which then resulted in a long delay, and the MYSQL error.

You need to debug what that delay is, and solve the root of the issue.

Another example could be when customers sign up for newsletter at checkout (hence why only some are affected) - if you are using an external newsletter signup system, that signup sync could cause delays in the checkout, if not properly implemented.

Your best way to solve this, and identify the lag is to use NewRelic.

ref:

https://github.com/ProxiBlue/OrderSyncQueRunner

http://www.proxiblue.com.au/blog/new-relic/

2
  • It doesnt makes much sense being "sales_order_place_after", because the event is fired when the order is already created in magento, and in this case of the post, the order is not created in magento but already was paid on paypal.
    – Pedro
    Commented Oct 13, 2020 at 10:03
  • The error can happen within a transaction, and is thus not commited to mysql as it is never completed / finalized
    – ProxiBlue
    Commented Oct 15, 2020 at 5:10
1

It's probably an issue with the server... I have this exact issue, but when I changed my cron jobs to once daily, versus every 5 minutes, the problem went away. You may want to look into optimizing your site/server, or moving to a new host.

1
  • 1
    The fact changing cron job times to more rear point not on the server but Magento. Commented Dec 16, 2014 at 12:45
0

Possibly this may be related to MySQL issue, let's check the log first. My case is, this MySQL error log appear near the time that the issue orders happens:

Aborted connection 1198255 to db: '...' user: '...' host: 'localhost' (Got an error reading communication packets)

Then I did follow this guide to make it fixed: https://dba.stackexchange.com/a/19139

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.