On my dev server, I’m trying to upgrade our 1.5.1 shop to 1.6.1. The update itself goes well and the shop seems to work fine after the update.
After some more testing I found that existing customers, who already had placed an order before, are getting a message that the order cannot be completed when they want to finish the checkout process.
After some digging I found the following error in the exceptions log:
It seems that magento wants to use the previous ordernumber of the customer to create the new order, which results in a duplicate entry.
I suspected some extensions so I disabled them before upgrading, no joy.
Updated the extensions and then updated magento, no joy.
Disabled the custom theme, no joy.
Anybody a clue on where to find the source of this problem?
processing the same order through magento backend seems to go fine, so i’ts only a frontent problem.
I just checked this table but it seems to be ok. Tried to increase the number and tried again but same error.
It seems that, in my case, magento only checks this table for new customers / customers first order:
Current increment id let’s say 57
Customer A has placed 3 orders, last order was 29
Customer B has placed 1 order, last order 51
New customer places order, everything goes well, gets ordernumber 58, increment goes to 58
Customer B places order, error: log shows magento wants to use order number 51, which, off course, is duplicate
Customer A places order, error: log shows magento wants to use order number 29. Again, exactly the same number as this customers last order and off course duplicate
Another new customer places order, no problem, this will get order number 59 and increment also increases to 59
Just tried, same error. New customers get the increased order number. Existing customers that already place an order before keep getting their last order number.
@TomvH:: The problem is that the quoteId is reserved for customers who have already started an order. If you wanted to you could remove all the items from the quote’s and then the customer would not be able to order anything they had saved.
@TomvH:: The problem is that the quoteId is reserved for customers who have already started an order. If you wanted to you could remove all the items from the quote’s and then the customer would not be able to order anything they had saved.
Hi Brent,
Thanks again for your answer, but that also doesn’t seem to be the problem. I just tried to upgrade again, but first I emptied the shopping carts of my test accounts if they had anything in it.
Same error all over again. All the existing accounts but with no previous orders work fine, the others don’t.
I am having the same issue. It seems magento is trying to insert a row to SALES_FLAT_ORDER with the increment_id of the previous order of the customer.
Ok, I did the following: I update the conflicting line in the SALES_FLAT_ORDER table and changed the increment_id to 99999999. I then tried placing the order again and it succeeded. BUT the increment_id of the new order is the same as the increment_id of the last order the customer had placed!! This is a major bug, and unless it is caused by a misbehaving addon I am surprised it hasn’t been caught by the magento development team.
Same here and question is this critical important bug or critical important addon error bug.
But it might be magento error, since we sometimes get errors for sagepay payments with duplicated order id numbers, but payments are different and taken (but those two payments should contain different order number? or not?).
Nope. Bug is still there… It’s not just the flat_order table you need to update, but any associated eav_entity_store values too.
So, go to the admin->sales->orders screen and look for the last successful order id.
go into eav_entity_store and in the last_increment_id column look for increments that match the last good order and update them by 2.
Nope. Bug is still there… It’s not just the flat_order table you need to update, but any associated eav_entity_store values too.
So, go to the admin->sales->orders screen and look for the last successful order id.
go into eav_entity_store and in the last_increment_id column look for increments that match the last good order and update them by 2.
Hope this helps.
I know I’m late on this but I just had to say.. this has saved me. I was having this duplication error and pulling out my hair, other solutions suggested removing all logs, quotes, and removing the MYSQL unique check.. All I did was increment eav_entity_store and it fixed my problem right away…