Cannot initialize the indexer process

拟墨画扇 提交于 2019-12-06 01:55:25

try to run indexing with script file.

Create a file reindexing.php in the root.

<?php
 require_once 'app/Mage.php';
 $app = Mage::app('admin');
 umask(0);
 for ($index = 1; $index <= 8; $index++) {
     $process = Mage::getModel('index/process')->load($index);
     $process->reindexAll();
 }
 ?>

Then clear the magento all cache and run this file as http://domain.com/reindexing.php

I tried all the things that I could find over the internet to solve this problem but nothing helped. So, I decided I will solve this problem on my own. I debugged and traced the error all the way to the database and I learned that the issue with reindexing, "Exception message: Cannot create table without columns comments" means some of the values of the column frontend_label in eav_attribute was null or 0. So first I needed to run the following query and add the frontend label if they are null or zero and add the value in the frontend label of the attributes whose value was null or zero.

Voila, and the issue was fixed:

Here are the queries that I ran to fix the issue:

List null values:

SELECT e.* FROM
eav_attribute e LEFT JOIN eav_entity_type et ON e.entity_type_id = et.entity_type_id WHERE et.entity_type_code = 'catalog_category' AND e.frontend_label is NULL

Then I fixed the null values:

SELECT e.* FROM
eav_attribute e LEFT JOIN eav_entity_type et ON e.entity_type_id = et.entity_type_id WHERE et.entity_type_code = 'catalog_category' AND e.frontend_label='0'

After that I could run the indexing process from admin or console and it ran flawlessly.

Hope you folks will find this solution helpful.

user3713736
**SOLUTION:**

Enabled magento DB logging via:
lib/Varien/Db/Adapter/Pdo/Mysql.php 
Down around line 86,

you’ll see the following class variables:
protected $_debug = false;
protected $_logAllQueries = false;
protected $_logCallStack = false;
protected $_debugFile = ‘var/debug/sql.txt’;

Change all to true and then ran the reindex. 
Then checked the log file specified above. 

I had this issue and it turned out that a table needed to be repaired.

Run the following command from shell:

php {directory_root}/shell/indexer.php --reindex

I had an error like the following:

'General error: 145 Table './{datbasename}/mg_catalogsearch_fulltext' is marked as crashed and should be repaired'

I ran a mysql REPAIR on the mentioned table and could then run the indexer without issue.

I tried this tutorial to solve Magento cannot initialize the indexer process error. There may be some reasons for this error

  • Low value for Memory limit and maximum execution time

  • No writing Permission /var

  • Too many products caused overload.

  • Corruption of tables in database You can try the following solutions

Increase Memory limit and maximum execution time

Open php.ini file and add these 2 lines

memory_limit = 2048M

max_execution_time = 300

Allow writing permission for /var folder

You can set 755 or 777 for /var folder and see if the error is gone.

Run reindexing via command line Open ssh client and run the following command

php shell/indexer.php --reindex

Repair database using phpmyadmin

Open your phpmyadmin and perform all database repair

To resolve the "Cannot initialize the indexer process" you need to run follow below step

Solution 1 :-

This is usually occurred when we Enable "Use Flat Catalog Category" and "Use Flat Catalog Product"

Please connect SSH via Putty run below command:-

These is Individual commands for re-indexing:-

php shell/indexer.php --reindex catalog_category_flat

php shell/indexer.php --reindex catalog_category_product

php shell/indexer.php --reindex catalogsearch_fulltext

OR run all re-indexing:-

php shell/indexer.php --reindexall

Then clear the magento all cache.

Solution 2 :-

Try to run indexing with PHP script file. Create a file reindex_custom.php in the root.

<?php
require_once("app/Mage.php");
Mage::app('default');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
try{
$indexerByShell = Mage::getBaseDir().'/shell/indexer.php';
if(file_exists($indexerByShell))  
 { 
$indexListByCode = array(
"catalog_product_attribute",
                       "catalog_product_price",
                       "catalog_product_flat",
                       "catalog_category_flat",
                       "catalog_category_product",
                       "catalog_url",
                       "catalogsearch_fulltext",
                       "cataloginventory_stock"
    );
        //reindex using magento command line  
        foreach($indexListByCode as $indexer)  
        {  
            echo "reindex $indexer \n ";  
            exec("php $indexerByShell --reindex $indexer");  
        } 
    }
}catch(Exception $e){
    echo $e;
}
?>

Then clear the magento all cache and run this file as http://example.com/reindex_custom.php

There might be two situation occur due to this

1. use this Documentation to flush your data just go throw this LINK

OR second is

2. to disabling all my 3rd party extensions, except for the ones marked Mage_*.

Hope it will sure help you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!