0

No changes, updates, or upgrades of any sort in the last few months to the system, Magento 1.9.2.2

Order saving error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100084489' for key 'UNQ_SALES_FLAT_ORDER_INCREMENT_ID', query was: INSERT INTO sales_flat_order (coupon_code, protect_code, shipping_description, is_virtual, store_id, customer_id, base_discount_amount, base_grand_total, base_shipping_amount, base_shipping_tax_amount, base_subtotal, base_tax_amount, base_to_global_rate, base_to_order_rate, discount_amount, grand_total, shipping_amount, shipping_tax_amount, store_to_base_rate, store_to_order_rate, subtotal, tax_amount, total_qty_ordered, customer_is_guest, customer_note_notify, customer_group_id, gift_message_id, quote_id, base_shipping_discount_amount, base_subtotal_incl_tax, shipping_discount_amount, subtotal_incl_tax, weight, customer_dob, increment_id, applied_rule_ids, base_currency_code, customer_email, customer_firstname, customer_lastname, customer_middlename, customer_prefix, customer_suffix, customer_taxvat, discount_description, global_currency_code, order_currency_code, remote_ip, shipping_method, store_currency_code, store_name, x_forwarded_for, customer_note, created_at, updated_at, total_item_count, customer_gender, hidden_tax_amount, base_hidden_tax_amount, shipping_hidden_tax_amount, base_shipping_hidden_tax_amnt, shipping_incl_tax, base_shipping_incl_tax, auctaneapi_discounts) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '2018-12-19 16:55:40', '2018-12-19 16:55:40', ?, ?, ?, ?, ?, ?, ?, ?, ?)

Went to database to eav_entity_store, tried increasing order ID by 1, invoice ID, etc - multiple times - no luck. Any other ideas?

1
  • PS. It works after several attempts, and order goes through. Each time I try, the ID does increase, but error still shows Dec 19 '18 at 17:03
0

I'm not sure the cause, but I have seen this error when Magento is attempting to save an order that has reserved an increment ID that is associated with a previous order.

The solution is to search the sales_flat_quote table for a row with reserved_order_id matching the duplicate entry. Setting reserved_order_id to NULL for this row allows the order to be saved using the next available increment ID.

Not a solution, but an answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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