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 istifadəçi bunu faydalı hesab edir
Bu cavab sizə kömək etdi?

Uyğun məqalələr

How to add and edit attribute sets in Magento

Each product that you add in Magento can be configured thanks to a set of attributes. These are...

How to Show or hide out of stock products in Magento

The process is fairly straight forwardShow out of stock products in Magento   Login to the...

Why is Magento cron job not working?

cPanel + CageFS and CloudLinux's PHP switcher may cause problems with Magento CRON. Until this is...

How to add and edit admin users and user roles in Magento

In addition to the admin account that's created while installing your Magento you can add more...

How to add and edit polls in Magento

Adding and editing polls in Magento is easy. You can do that from the admin panel. Go to...