0

How to solve below error,

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '26974-207-1-0-26974' for key 'PRIMARY', query was: INSERT INTO catalog_product_index_eav_temp (entity_id,attribute_id,store_id,value,source_id) VALUES (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), ( ?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), etc

There is no table like catalog_product_index_eav_temp instead of available catalog_product_index_eav_tmp how to manage this error?

  • When you face this error? During Migration? – Sanjay Gohil Nov 14 '19 at 5:27
  • No, migration process completed. If i try re-index here am getting this error. – zus Nov 14 '19 at 5:28
1

Entry key '26974-207-1-0-26974', where 26974 is product_id, 207 is attribute_id, 1 is store_id, 26974 is attribute_value_id for which is getting this issue.

So if suppose attribute 168 type is varchar, then its values will be in catalog_product_entity_varchar.

Now search for attribute 207 along with entity_id 26974, you can see there is some values in 'value' column.

Edit that row, you will see there is more than 1 entry (comma separated) for same value_id (here 26974), just remove all other duplicates values from there and save it.

Flush cache and re-run index command.

If error comes again then again (that may come for other products as well) check and fix in similar way.

Not sure why magento puts duplicate values for multi-select.

0

@Zus Try adding real value from attribute_id 207 in value column instead of 0 this is a example of no value from my case: enter image description here

Because 0 doesn't exist it can cause the error: or just ad no_selection

  • Which table i need to edit? – zus Nov 14 '19 at 12:11
  • @zus The one on your screen shot. There are 2 rows with 0 values for attribute 207 – Juliano Vargas Nov 14 '19 at 14:08

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.