Magento – Fix SQL Error: Integrity Constraint Violation: 1062 Duplicate Entry

adminerrorMySQLproductshopping-cart-price-rules

Every time I update my products in /admin I get this sql error

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'2-0-0-1-1-375-0' for key 'EAA51B56FF092A0DCB795D1CEF812B7B', query
was: INSERT INTO catalogrule_product
(rule_id,from_time,to_time,website_id,customer_group_id,product_id,action_operator,action_amount,action_stop,sort_order,sub_simple_action,sub_discount_amount)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

It doesn't seem to actually affect anything but it kind of worries me.

Best Answer

Backup the table catalogrule_product.
Truncate it.
Run the reindex process from the command line.
If something goes wrong, just restore you table.

Related Topic