1

I'm getting the famous "cannot initialize indexer process" while indexing the prices. In the log I get the below error. This error appeared after that I changed in System->Configuration->Catalog->Price the scope to website and then back to global.

What I tryed so far: - flush cache - removing all the products in catalog - readding the products in catalog

Have no idea how to solve this.

014-03-08T00:10:43+00:00 DEBUG (7): Exception message: SQLSTATE[21S01]: Insert value   list does not match column list: 1136 Column count doesn't match value count at row 1
Trace: #0 /u01/www/cellxpressions.net/lib/Varien/Db/Statement/Pdo/Mysql.php(110):  Zend_Db_Statement_Pdo->_execute(Array)
#1 /u01/www/cellxpressions.net/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /u01/www/cellxpressions.net/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /u01/www/cellxpressions.net/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `sm...', Array)
#4 /u01/www/cellxpressions.net/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `sm...', Array)
5 /u01/www/cellxpressions.net/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(455): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `sm...')
#6 /u01/www/cellxpressions.net/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(379): Mage_Catalog_Model_Resource_Product_Indexer_Price->_prepareTierPriceIndex()
#7 /u01/www/cellxpressions.net/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexAll()
#8 /u01/www/cellxpressions.net/app/code/core/Mage/Index/Model/Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll()
#9 /u01/www/cellxpressions.net/app/code/core/Mage/Index/Model/Process.php(258): Mage_Index_Model_Process->reindexAll()
#10 /u01/www/cellxpressions.net/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(182): Mage_Index_Model_Process->reindexEverything()
#11 /u01/www/cellxpressions.net/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Index_Adminhtml_ProcessController->massReindexAction()
#12 /u01/www/cellxpressions.net/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('massReindex')
#13 /u01/www/cellxpressions.net/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /u01/www/cellxpressions.net/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#15 /u01/www/cellxpressions.net/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#16 /u01/www/cellxpressions.net/index.php(87): Mage::run('', 'store')
#17 {main}

The query which is causing the crash is:

INSERT INTO `sm_catalog_product_index_tier_price` SELECT `tp`.`entity_id`, `cg`.`customer_group_id`, `cw`.`website_id`, MIN(IF(tp.website_id = 0, ROUND(tp.value * cwd.rate, 4), tp.value)) FROM `sm_catalog_product_entity_tier_price` AS `tp` INNER JOIN `sm_customer_group` AS `cg` ON tp.all_groups = 1 OR (tp.all_groups = 0 AND tp.customer_group_id = cg.customer_group_id) INNER JOIN `sm_core_website` AS `cw` ON tp.website_id = 0 OR tp.website_id = cw.website_id INNER JOIN `sm_catalog_product_index_website` AS `cwd` ON cw.website_id = cwd.website_id WHERE (cw.website_id != 0) GROUP BY `tp`.`entity_id`, `cg`.`customer_group_id`, `cw`.`website_id` ON DUPLICATE KEY UPDATE `min_price` = VALUES(`min_price`)

1 Answer 1

1

Create a script in your html directory, for example programmatically_refresh_reindex.php:

require_once 'app/Mage.php';
umask( 0 );
Mage :: app( "default" );
$ver = Mage :: getVersion();
$userModel = Mage :: getModel( 'admin/user' );
$userModel -> setUserId( 0 );
Mage :: getSingleton( 'admin/session' ) -> setUser( $userModel );

function refresh_cache() 
{    
    try {
        $allTypes = Mage::app()->useCache();
        foreach($allTypes as $type => $blah) {
          Mage::app()->getCacheInstance()->cleanType($type);
        }
      } catch (Exception $e) {
          echo $e->getMessage() . " <br>";
      }
    try{
        echo "<br>";
        $indexingProcesses = Mage::getSingleton('index/indexer')->getProcessesCollection(); 
        foreach ($indexingProcesses as $process) {
              $process->reindexEverything();
        }
    }
    catch (Exception $e){
        echo $e->getMessage() . " <br>";
    }
}

refresh_cache(); 
echo "<br>";  
echo "All cache types refreshed & all processes reindexed<br />";

See if Magento then managed to initialize the indexer by running the script by accessing yourwebsite.com/programmatically_refresh_reindex.php in a browser.

Let me know if this still fails.

4
  • I get this error: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1. May it depend that for mistake I removed once the special_to_price from eav_attribute table and then restored it ? Commented Mar 10, 2014 at 1:23
  • It could definitely be related to that, you should check out this link: magentocommerce.com/wiki/1_-_installation_and_configuration/… - it may be able to help you resolve things.
    – Moose
    Commented Mar 10, 2014 at 6:00
  • Did it. using a old database backup as a base. No effects sorted. It tells me that the db is not corrupted or something like that. Commented Mar 10, 2014 at 8:05
  • It's strange. The logs tell me about an error while indexing the tier prices but I never touched the tierprices. I'm importing the products using magmi. Commented Mar 10, 2014 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.