SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2828-148-1-471' for key 'PRIMARY'

While trying to reindex your store using the command line, you stumble on the following error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2828-148-1-471'  for key 'PRIMARY'


In the case of the product attribute indexer, this means there's a constraint error while saving a record to the catalog_product_index_eav_idx table.


How to find the product that is causing the issue:
2828-148-1-471 refers to:
  • product entity id: 2828
  • attribute id: 148
  • store id: 1
  • value: 471

Solutions:
The first solution to try would be to simply locate the product in your Magento backend and save it.  Once done, simply reindex your store from the command line and see if the problem occurs again.

The second one would be to delete the affected product followed by a full reindex.


In any cases, don't hesitate to open a ticket and have our team resolve that one.

  • 5 Користувачі, які знайшли це корисним
Ця відповідь Вам допомогла?

Схожі статті

How to add and manage currencies in Magento

In Magento you can allow customers to view the prices of the products in your shop in different...

Migrating your CMS from one server to another one

From time to time, you may need to push your CMS from your staging env to your production...

Reset Files and Directories permissions

From time to times, we must fix permissions on files and directory in order to secure an...

Clearing cache from the shell

Magento often needs to refresh it's cache. In some occasion, you may want to flush either...

How to add a custom link to the top navigation in Magento

By default, Magento's top navigation contains links to your product categories. But what if you...