cancel
Showing results for 
Search instead for 
Did you mean: 

Reindexing: catalog_product_attribute generates SQLSTATE[23000]: Integrity constraint violation

Reindexing: catalog_product_attribute generates SQLSTATE[23000]: Integrity constraint violation

Hi Everyone!

 

- I imported products through the CSV import feature. 

- The import went without any issues.

- All imported products are listed in admin panel.

- the problem is with indexing catalog_product_attribute only. The rest indexes reindex ok.

 

When I tried reindex the index (in console) to make them visible in the frontend store, I got SQLSTATE[23000]: Integrity constraint violation error:

 

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8942-138-1-265' for key 'PRIMARY', query was: INSERT INTO `mag_catalog_product_index_eav_idx` (`entity_id`,`attribute_id`,`store_id`,`value`) VALUES (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?), (?, ?, ?, ?).....

 

Please advice me what shall I do? Thanks!