5

I have a problem re-indexing my Magento website. Sometimes I get the error "There was a problem with reindexing process", but sometimes it's "Cannot initialize the indexer process".

I read a lot of related topics on google which say that I should delete /var/locks folder in my root mangento folder. I don't have such folder in my /var/ folder.

I am having problems reindexing the "Product Prices, Index product prices" index.

Could you tell me what can I do in order to fix this issue? Thanks


Magento Version 1.9 (the latest one) Hosting OS: Linux technical

Changing memory limit: I contacted my domain host and they told me my php memory was 128M. However it was only possible to change it to 256M because of my hosting plan. Despite the change, the problem remained.

I was able to reindex all of the things in the index management section, until yesterday. If you say that I have run out of memory (which was 128M), is it possible to clean it in some way so I can get space and be able to reindex again?

Var Folder: I have the permissions required - 755 - which lets the owner to write - but still no locks folder. The var folder is in my root folder and not in the tmp folder.

I have access to my backend, I am able to Flush all Magento cache. The only thing I am not able to do is reindex this Catalog product price.

Yesterday I created some new attributes and products. Just after that I wasn't able to reindex. Any other suggestions please? Thanks in advance.

  • Are you using any caching? Do you have access to your backend? Disable all and see if the folders appear. – SR_Magento Jan 29 '15 at 21:34
5

Svetoslav,

In the future please post the specs about your hosting OS, version of Magento, etc. I am going to just post some typical solutions to your problem.

Run Indexing from the CLI

  1. from the CLI at the root of your magento installation

    php shell/indexer.php --reindex catalog_product_price
    

No folders in var/

  1. Make sure that the var/ folder has the correct file permissions and ownership. Magento needs to write to those folders.

    Magento Permissions & Privileges

  2. I recently ran across an install of magento that located the var folder in the root tmp folder of the server, you may want to check there. It was located in /tmp/magento/var/ If your var folder is located there, it is because you have a permissions issue.

Change your memory limit

I agree with sean! Change this in your .htaccess that is located in your site root

ini_set('memory_limit','2048M');
  • Magento Version 1.9 (the latest one) Hosting OS: Linux technical Changing memory limit: I contacted my domain host and it was only possible to change it to 256M because of my hosting plan. Despite the change, the problem remained. If you say that I have run out of memory (which was 128M), is it possible to clean it in some way so I can get space and be able to reindex again? Var Folder: I have the permissions required - 755 It is in my root folder Yesterday I created some new attributes and products. Just after that I wasn't able to reindex. Any other suggestions please? Thanks in advance. – Svetoslav Feb 2 '15 at 11:10
3

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://domain.com/reindex_custom.php

2

I got this error while trying to reindex the Product Prices index after installing Organic Internet's Simple Configurable Products extension. I fixed it by going to Magento Connect Manager (Admin > System > Connect Manager) and uninstalling the extension I previously installed. After successfully uninstalling the extensions, I was able to go to the Index Management page and refresh all the indexes, including the Product Prices index. Then I was able to install the extension manually without problems. It's also handy to have backups readily available for situations like this!

1

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

  • Low value for Memory limit and maximum execution time in Php.ini file

  • No writing Permission for folder /var

  • Too many products or store views, the re-indexing process can’t be done via Magento backend

  • 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

0

You are probably running out of memory during your indexer process. Open index.php and add this near the top:

ini_set('memory_limit','2048M');

If that doesn't work then contact your host to make sure that your php memory limit is set to at least 1024M.

0

The memory limit is set in the Magento .htaccess file and this will override anything in php.ini.

Edit this section to increase the memory limit.

############################################
## adjust memory limit

#    php_value memory_limit 64M
    php_value memory_limit 2048M
    php_value max_execution_time 18000

After doing this I was able to run the indexer.php from the command line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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