Matthew Dolman
Matthew Dolman

Reputation: 1800

"There was a problem with reindexing process." after product import

Using Magento 1.6

I had to make some bulk changes to my catlog and so did a full product export, made the changes then imported the ammended file.

Afterwards there were a few index that needed updating, all of them except the "Product Attributes" index correctly.

When I try to re index that one I get the error "There was a problem with reindexing process."

There are no new errors created in var/report and so I have no idea what the problem is.

csv -> http://lazytrek.com/magento_export.csv

edit - As per OSdave's suggestion I got the following error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '84-142-1-58' for key 'PRIMARY'

Upvotes: 5

Views: 25963

Answers (7)

Ejilarasan J
Ejilarasan J

Reputation: 320

Double check the catalog_product_entity,catalog_product_entity_datetime,catalog_product_decimal,catalog_product_int, catalog_product_text,catalog_product_varchar table columns have with respective UNIQUE KEY's.

Upvotes: 0

Rajesh Jai
Rajesh Jai

Reputation: 71

Thanks OSdave,

It's same error for me, I changed this

in Mage_Index_Adminhtml_ProcessController edit line 138, from Mage::helper('index')->__('Cannot initialize the indexer process.') to $e->getMessage():

then tried re-index, it's shows the below error

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8308-2018-1-2788' for key 'PRIMARY', query was: INSERT INTO catalog_product_index_eav_idx (entity_id,attribute_id,store_id,value

then, I remove the product with ID '8308' and recreated and after tried to re-index, it working fine.

But don't the exact root cause of issue. I hope it's help to someone!

Upvotes: 0

Tush
Tush

Reputation: 189

Remove the lock files in var/locks and try again.

I'd advise you reindex in SSH if you have a large data set

php shell/indexer.php -reindexall

Source :: https://magento.stackexchange.com/questions/24729/there-was-a-problem-with-reindexing-process

Upvotes: 4

JR Warren
JR Warren

Reputation: 317

Last night, I was having the same problem. After following the steps outlined by OSdave to get the more precise error message, I saw my error was the same as yours.

But it wasn't just with 1 product there were several hundred products causing errors (each one saved brought up a new one). And it wasn't all with the same attribute (I'd updated multiple attributes across a database of over 4,000 products in my last import).

Since everything seemed to actually be in the database correctly (since re-saving seemed to be fixing it and giving the proper data to the final saved product), I had an idea.

Why not export all 4k products, and then re-import the same file without modification and see if that clears it.

It worked!

tl;dr: If you're having this problem with multiple products needing to be re-saved, export your whole inventory (or the relevant section if you can segment in a useful way), and re-import the same file with no modifications.

I'm using Magento v 1.9.0.1

Upvotes: 0

Phillip
Phillip

Reputation: 21

I also had this issue and was getting the following in my exception log:

Integrity constraint violation: 1062 Duplicate entry '706-168-2-60' for key 'PRIMARY''

Eventually I discovered (as posted above) that this was a problem with product ID 706 (the first digits before '-' are the product ID.

Simply opening this product within the Magento admin and saving it fixed the issue with this product, however, in my case I also had a problem with product 707, 708, 709, etc, etc...

What I then discovered is the second set of digits identify the attribute ID. I figured out which attribute this was by opening any attribute and replacing it's ID in the URL with the one in the exception log.

I then searched for a series of products (in my case 700 to 800), selected them all and used "Actions" "Update attributes" in the top right of the Catalog - Manage Products page.

I amended this attribute for all of them (which was fine for me) and the indexer worked.

If you can't set this attribute to be the same for all your products I'd suggest a bulk import to reset just this.

Upvotes: 2

Yormann
Yormann

Reputation: 79

After struggling for hours I finally found a solution. In fact, It's a very simple solution:

  • Backup your database
  • Open phpMyAdmin and truncate (empty) the table catalog_product_flat_1

That's it. After that I was able to index all data and, until now, everything else works perfectly. This worked for me. I hope it works for you too.

PS: using Magento 1.6.0.0

Upvotes: 7

Matthew Dolman
Matthew Dolman

Reputation: 1800

OK I fixed this myself

In the SQL error the first number (in my case 84) indicates the product id, something did not import properly with that ID, I went into the product, saved it manually and hey presto I could re-index.

Hope that helps someone :-)

Upvotes: 4

Related Questions