You are viewing an old revision of this post, from July 6, 2015 @ 18:10:21. See below for differences between this version and the current revision.

MAGENTO – SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘x-xxxxxxxxxx-x-x-x-xxx-x’ for key ‘EAA51B56FF092A0DCB795D1CEF812B7B’

Some weeks ago  I was trying to import/update some products in Magento 1.7 and I got the following error:

An error occurred while saving this configuration: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-1332892800-0-1-0-209-0' for key 'EAA51B56FF092A0DCB795D1CEF812B7B'

The error message by itself doesn’t help that much and trying to google it didn’t bring any relevant result.

After a long time debugging and trying to figure out where the key ‘EAA51B56FF092A0DCB795D1CEF812B7B’ comes from, I found it in the  “catalogrule_product” table. It is a unique key which makes sure that the values in the columns: “rule_id”, “from_time”, “to_time”, “website_id”, “customer_group_id”, “product_id” and “sort_order” are unique.

WHY THIS PROBLEM HAPPENS?

Two things happen if you try to update a product using the Magento import module (In the backend Menu: System->import/export->import) and you have an active catalog promotion rule, which  applies to that product. First Magento deletes (or at least it tries to delete) all rows, related to the product, in the “catalogrule_product” table. Then Magento inserts the deleted rows again (strange I know, but this is how it works). Due to a bug in Magento core code, the delete step fails.

In the file app/code/core/Mage/CatalogRule/Model/Resource/Rule.php, lines 89-93, Magento tries to delete the rows using the code bellow:

$write->delete(
$this->getTable('catalogrule/rule_product'),
$write->quoteInto('rule_id=?', $ruleId)
. $write->quoteInto('and product_id in (?)', implode(',' , $rule->getProductsFilter()))
);

It generates a delete SQL statement, similar to:

DELETE FROM 'catalogrule_product' WHERE rule_id = '1' AND product_id IN ('1,2,3,4')

However, the correct SQL statement should be:

DELETE FROM 'catalogrule_product' WHERE rule_id = '1' AND product_id IN ('1','2','3','4')

Note the difference in the “IN” clause. Because of that Magento doesn’t delete all the rows that should be deleted and when it tries to insert them again, you get a “Duplicate entry” error.

HOW TO FIX IT?

You can fix the error using one of the following methods:

METHOD 1

Deactivate all catalog promotion rules:

  • In the backend menu: Promotions-> Catalog Price Rules
  • Set the status of all the rules to inactive
  • Apply the rules

Now you can Import/update free of errors.  When the import/update is done, you can active the rules again.

 

METHOD 2

Using the following SQL command to truncate tables:

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE `catalogrule`;
TRUNCATE `catalogrule_affected_product`;
TRUNCATE `catalogrule_customer_group`;
TRUNCATE `catalogrule_group_website`;
TRUNCATE `catalogrule_product`;
TRUNCATE `catalogrule_product_price`;
TRUNCATE `catalogrule_website`;


SET FOREIGN_KEY_CHECKS = 1;

Revisions

Revision Differences

July 6, 2015 @ 18:10:21Current Revision
Content
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">
Deleted: Sometime ago&nbsp; I was trying to import/update some products in Magento 1.6 and I got the following error: Added: Some weeks ago &nbsp;I was trying to import/update some products in Magento 1.7 and I got the following error:
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: <code style="border: 0px; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; font-stretch: normal; line-height: normal;">An error occurred while saving this configuration: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &#39;1-1332892800- 0-1-0-209-0&#39; for key &#39;EAA51B56FF092A0DCB795D1CEF812B7B&#39;</code>Unchanged: <code style="border: 0px; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; font-stretch: normal; line-height: normal;">An error occurred while saving this configuration: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &#39;1-1332892800- 0-1-0-209-0&#39; for key &#39;EAA51B56FF092A0DCB795D1CEF812B7B&#39;</code>
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">
Unchanged: The error message by itself doesn&rsquo;t help that much and trying to google it didn&rsquo;t bring any relevant result.Unchanged: The error message by itself doesn&rsquo;t help that much and trying to google it didn&rsquo;t bring any relevant result.
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">
Deleted: After a long time debugging and trying to figure out where the key &lsquo;EAA51B56FF092A0DCB795D1CEF812B7B&rsquo; comes from, I found it in the&nbsp; &ldquo;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">catalogrule_ product</em>&rdquo; table. It is an&nbsp;<a href="http:// en.wikipedia.org/ wiki/Unique_key" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(50, 102, 147); text-decoration: none;">unique key</a>&nbsp;which makes sure that the values in the columns: &ldquo;rule_id&rdquo;, &ldquo;from_time&rdquo;, &ldquo;to_time&rdquo;, &ldquo;website_id&rdquo;, &ldquo;customer_ group_id&rdquo;, &ldquo;product_id&rdquo; and &ldquo;sort_order&rdquo; are unique. Added: After a long time debugging and trying to figure out where the key &lsquo;EAA51B56FF092A0DCB795D1CEF812B7B&rsquo; comes from, I found it in the&nbsp; &ldquo;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">catalogrule_ product</em>&rdquo; table. It is a&nbsp;<a href="http:// en.wikipedia.org/ wiki/Unique_key" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(50, 102, 147); text-decoration: none;">unique key</a>&nbsp;which makes sure that the values in the columns: &ldquo;rule_id&rdquo;, &ldquo;from_time&rdquo;, &ldquo;to_time&rdquo;, &ldquo;website_id&rdquo;, &ldquo;customer_ group_id&rdquo;, &ldquo;product_id&rdquo; and &ldquo;sort_order&rdquo; are unique.
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Deleted: <a href="http:// renatomarcelino.com/wp-content/ uploads/2012/ 03/table1.jpg" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(50, 102, 147); text-decoration: none;"><img alt="" class="wp-image-123 aligncenter" height="201" scale="0" src="http://renatomarcelino.com/ wp-content/uploads/2012/03/ table1-1024x458.jpg" style="border: 1px solid rgb(204, 204, 204); margin-top: 0.4em; margin-bottom: 2em; clear: both; max-width: 100%; height: auto; padding: 6px;" title="table" width="450" /></a>Added: WHY THIS PROBLEM HAPPENS?
Unchanged: </p>Unchanged: </p>
Deleted: <h3 style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 22px; font-weight: bold; margin: 0px 0px 0.8125em; outline: 0px; padding: 0px; vertical-align: baseline; clear: both; color: rgb(55, 55, 55);"> 
Deleted: WHY THIS PROBLEM HAPPENS? 
Deleted: </h3> 
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">
Unchanged: Two things happen if you try to update a product using the Magento import module (In the backend Menu: System-&gt;import/ export-&gt;import) and you have an active catalog promotion&nbsp;rule, which&nbsp; applies to that product. First Magento deletes (or at least it tries to delete) all rows, related to the product, in the &ldquo;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">catalogrule_ product</em>&rdquo; table. Then Magento inserts the deleted rows again (strange I know, but this is how it works). Due to a bug in Magento core code, the delete step fails.Unchanged: Two things happen if you try to update a product using the Magento import module (In the backend Menu: System-&gt;import/ export-&gt;import) and you have an active catalog promotion&nbsp;rule, which&nbsp; applies to that product. First Magento deletes (or at least it tries to delete) all rows, related to the product, in the &ldquo;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">catalogrule_ product</em>&rdquo; table. Then Magento inserts the deleted rows again (strange I know, but this is how it works). Due to a bug in Magento core code, the delete step fails.
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">
Unchanged: In the file&nbsp;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">app/ code/core/Mage/ CatalogRule/ Model/Resource/ Rule.php</em>, lines 89-93, Magento tries to delete the rows using the code bellow:Unchanged: In the file&nbsp;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">app/ code/core/Mage/ CatalogRule/ Model/Resource/ Rule.php</em>, lines 89-93, Magento tries to delete the rows using the code bellow:
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: <code style="border: 0px; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; font-stretch: normal; line-height: normal;">$write- &gt;delete(<br />Unchanged: <code style="border: 0px; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; font-stretch: normal; line-height: normal;">$write- &gt;delete(<br />
Unchanged: $this-&gt;getTable( &#39;catalogrule/ rule_product&#39;),<br />Unchanged: $this-&gt;getTable( &#39;catalogrule/ rule_product&#39;),<br />
Unchanged: $write-&gt;quoteInto( &#39;rule_id=?&#39;, $ruleId)<br />Unchanged: $write-&gt;quoteInto( &#39;rule_id=?&#39;, $ruleId)<br />
Unchanged: . $write-&gt;quoteInto(&#39;and product_id in (?)&#39;, implode(&#39;,&#39; , $rule-&gt;getProductsFilter()))<br />Unchanged: . $write-&gt;quoteInto(&#39;and product_id in (?)&#39;, implode(&#39;,&#39; , $rule-&gt;getProductsFilter()))<br />
Unchanged: );</code>Unchanged: );</code>
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: It generates a delete SQL statement, similar to:Unchanged: It generates a delete SQL statement, similar to:
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: <code style="border: 0px; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; font-stretch: normal; line-height: normal;">DELETE FROM &#39;catalogrule_ product&#39; WHERE rule_id = &#39;1&#39; AND product_id IN (&#39;1,2,3,4&#39;)</code>Unchanged: <code style="border: 0px; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; font-stretch: normal; line-height: normal;">DELETE FROM &#39;catalogrule_ product&#39; WHERE rule_id = &#39;1&#39; AND product_id IN (&#39;1,2,3,4&#39;)</code>
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: However, the correct SQL statement should be:Unchanged: However, the correct SQL statement should be:
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: <code style="border: 0px; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; font-stretch: normal; line-height: normal;">DELETE FROM &#39;catalogrule_ product&#39; WHERE rule_id = &#39;1&#39; AND product_id IN (&#39;1&#39;,&#39; 2&#39;,&#39;3&#39; ,&#39;4&#39;)</code>Unchanged: <code style="border: 0px; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; font-stretch: normal; line-height: normal;">DELETE FROM &#39;catalogrule_ product&#39; WHERE rule_id = &#39;1&#39; AND product_id IN (&#39;1&#39;,&#39; 2&#39;,&#39;3&#39; ,&#39;4&#39;)</code>
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px; text-align: justify;">
Deleted: Note the difference in the &ldquo;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">IN</em>&rdquo; clause. Because of that magento doesn&rsquo;t delete all the rows that should be deleted and when it tries to insert them again, you get a &ldquo;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Duplicate entry</em>&rdquo; error. Added: Note the difference in the &ldquo;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">IN</em>&rdquo; clause. Because of that Magento doesn&rsquo;t delete all the rows that should be deleted and when it tries to insert them again, you get a &ldquo;<em style="border: 0px; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Duplicate entry</em>&rdquo; error.
Unchanged: </p>Unchanged: </p>
Unchanged: <h3 style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 22px; font-weight: bold; margin: 0px 0px 0.8125em; outline: 0px; padding: 0px; vertical-align: baseline; clear: both; color: rgb(55, 55, 55);">Unchanged: <h3 style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 22px; font-weight: bold; margin: 0px 0px 0.8125em; outline: 0px; padding: 0px; vertical-align: baseline; clear: both; color: rgb(55, 55, 55);">
Unchanged: HOW TO FIX IT?Unchanged: HOW TO FIX IT?
Unchanged: </h3>Unchanged: </h3>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: You can fix the error using one of the following methods:Unchanged: You can fix the error using one of the following methods:
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: <strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">METHOD 1</strong>Unchanged: <strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">METHOD 1</strong>
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: Deactivate all catalog promotion rules:Unchanged: Deactivate all catalog promotion rules:
Unchanged: </p>Unchanged: </p>
Unchanged: <ul style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em 2.5em; outline: 0px; padding-right: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <ul style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em 2.5em; outline: 0px; padding-right: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: <li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Unchanged: <li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Unchanged: In the backend menu: Promotions-&gt; Catalog Price RulesUnchanged: In the backend menu: Promotions-&gt; Catalog Price Rules
Unchanged: </li>Unchanged: </li>
Unchanged: <li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Unchanged: <li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Unchanged: Set the status of all the rules to inactiveUnchanged: Set the status of all the rules to inactive
Unchanged: </li>Unchanged: </li>
Unchanged: <li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Unchanged: <li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Unchanged: Apply the rulesUnchanged: Apply the rules
Unchanged: </li>Unchanged: </li>
Unchanged: </ul>Unchanged: </ul>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Deleted: Now you can Import/update&nbsp; free of errors.&nbsp; When the import/update is done, you can active the rules again. Added: Now you can Import/update free of errors.&nbsp; When the import/update is done, you can active the rules again.
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: &nbsp;Unchanged: &nbsp;
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: <strong>METHOD 2</strong>Unchanged: <strong>METHOD 2</strong>
Unchanged: </p>Unchanged: </p>
Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">Unchanged: <p style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; margin: 0px 0px 2em; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(55, 55, 55); line-height: 16.25px;">
Unchanged: Using the following SQL&nbsp;command to truncate tables:Unchanged: Using the following SQL&nbsp;command to truncate tables:
Unchanged: </p>Unchanged: </p>
Unchanged: <p>Unchanged: <p>
Unchanged: SET FOREIGN_KEY_CHECKS = 0;<br />Unchanged: SET FOREIGN_KEY_CHECKS = 0;<br />
Unchanged: TRUNCATE `catalogrule`;<br />Unchanged: TRUNCATE `catalogrule`;<br />
Unchanged: TRUNCATE `catalogrule_ affected_product`;<br />Unchanged: TRUNCATE `catalogrule_ affected_product`;<br />
Unchanged: TRUNCATE `catalogrule_ customer_group`;<br />Unchanged: TRUNCATE `catalogrule_ customer_group`;<br />
Unchanged: TRUNCATE `catalogrule_ group_website`;<br />Unchanged: TRUNCATE `catalogrule_ group_website`;<br />
Unchanged: TRUNCATE `catalogrule_ product`;<br />Unchanged: TRUNCATE `catalogrule_ product`;<br />
Unchanged: TRUNCATE `catalogrule_ product_price`;<br />Unchanged: TRUNCATE `catalogrule_ product_price`;<br />
Unchanged: TRUNCATE `catalogrule_website`;Unchanged: TRUNCATE `catalogrule_website`;
Unchanged: </p>Unchanged: </p>
Unchanged: <p>Unchanged: <p>
Unchanged: <br />Unchanged: <br />
Unchanged: SET FOREIGN_KEY_CHECKS = 1;Unchanged: SET FOREIGN_KEY_CHECKS = 1;
Unchanged: </p>Unchanged: </p>

Note: Spaces may be added to comparison text to allow better line wrapping.

2 Responses to “MAGENTO – SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘x-xxxxxxxxxx-x-x-x-xxx-x’ for key ‘EAA51B56FF092A0DCB795D1CEF812B7B’”

  1. xxx 09/07/2017 at 12:29 am #

    Yoᥙr way of telling everything in thiѕ paragraph is actually fastidiоus, all can easily know it,
    Thanks a lot.

Leave a Reply