Ecommerce


Magento Product Flat Data Not ReIndexing

Tag:

Date: 27 June 2012 Author: alex

Sympthon

The problems happends when you in Admin panel and try to re-index the Product Flat Data, it shows There was a problem with reindexing process. The actualy message for this error is

 

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento`.`mage1610_cataloginventory_stock_status`, CONSTRAINT `FK_CATINV_STOCK_STS_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON)

To view this detailed message, you will need to access file ProcessController.php from app/code/core/Mage/Index/controllers/Adminhtml/

On line 133, change to

 

   $this->_getSession()->addException($e,
                     Mage::helper('index')->__('There was a problem with reindexing process.'.$e->getMessage())

                );

Fix

To fix this problem:

1. Make sure your DB type for all your table set to be innodb

2. Search for “catalog_product_flat” there should only be 1 matching table. For us, its catalog_product_flat_4

Then run under SQL:

 

SET FOREIGN_KEY_CHECKS=0;

DROP TABLE catalog_product_flat_4

3.Go to the command line, Run manually updates:

 

php path/to/shell/indexer.php --reindex catalog_product_flat 

4. If you see the message like this, you will be good to go!

 

Reference

 Refer link : http://www.magentocommerce.com/boards/v/viewthread/261848/#t392980

 

 

Author Bio

Alex Li

All-round Developer, SilverStripe, Open-source, Objective-C, Github, Enjoy casual coffee with geeks @Zumo. Founder of @NovaInspire


1 Comments + Add Comment

  • 12 Oct 2012

    Full Document (7 months ago)

    You actually make it seem really easy with your presentation however
    I find this matter to be really one thing that I feel I might never understand.
    It seems too complex and very large for me. I'm having a look forward to your next submit, I_ll attempt to get the grasp of it!

RSS feed for comments on this page | RSS feed for all comments

Speak Your Words