Cannot initialize the indexer process

时间秒杀一切 提交于 2019-12-07 17:15:40

问题


Sorry for the question duplication, but I couldn't find the answers to the question, so I am posting it again. I tried re indexing the magento 1.7.0.2 via admin. Since the server is shared server, I cannot run the indexer via shell script; though I tried running it through cron, but it didn't worked either. After running the indexer process, I got the following error logged in the the exception.log file:

2013-07-14T17:03:55+00:00 DEBUG (7): Exception message: Cannot create table without columns comments

Trace: #0 /home/username/public_html/demo/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(604): Varien_Db_Adapter_Pdo_Mysql->createTable(Object(Varien_Db_Ddl_Table))

#1 /home/username/public_html/demo/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1418): Mage_Catalog_Model_Resource_Category_Flat->_createTable('4')
#2 /home/username/public_html/demo/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1431): Mage_Catalog_Model_Resource_Category_Flat->_createTables()
#3 /home/username/public_html/demo/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php(246): Mage_Catalog_Model_Resource_Category_Flat->reindexAll()
#4 /home/username/public_html/demo/app/code/core/Mage/Index/Model/Process.php(209): Mage_Catalog_Model_Category_Indexer_Flat->reindexAll()
#5 /home/username/public_html/demo/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#6 /home/username/public_html/demo/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(178): Mage_Index_Model_Process->reindexEverything()
#7 /home/username/public_html/demo/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Index_Adminhtml_ProcessController->massReindexAction()
#8 /home/username/public_html/demo/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('massReindex')
#9 /home/username/public_html/demo/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 /home/username/public_html/demo/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#11 /home/username/public_html/demo/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#12 /home/username/public_html/demo/index.php(87): Mage::run('', 'store')
#13 {main}

I don't know what the other solutions could be. I tried deleting lock files and reindexing again Also tried truncating the flat tables, it didn't worked either.

Any help is greatly appreciated.


回答1:


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




回答2:


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.




回答3:


**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. 



回答4:


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.




回答5:


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




回答6:


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




回答7:


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.



来源:https://stackoverflow.com/questions/17641799/cannot-initialize-the-indexer-process

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