Magento Re-Indexing Issue

enter image description here I ran into one problem in Magento. I have one Magento store with several website features that contains about 4,500 products. I want to reindex the product.

I had import of 4500 products via csv through the default magento functionality. after importing the product, the changes do not appear on the front side, so I went for index management and I found that two indexes are in processing state

1 Product Attributes 2 Flat Product Data

I have already taken the following steps:

1 try re-indexing it from admin system -> index management

2 try to do it manually by calling PHP script

require_once 'app/Mage.php'; umask( 0 ); Mage :: app( "default" ); $process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_flat'); $process->reindexAll(); 

OR

 $indexingProcesses = Mage::getSingleton('index/indexer')->getProcessesCollection(); foreach ($indexingProcesses as $process) { $process->reindexEverything(); } 

Also change the resolution of the var / locks folder to 777, rename this folder as well, and try to delete the .lock file that was created in this lock folder but did not get a solution.

I do not have SSH rights. So, is there any other solution that will help me solve the reindexing problem.

+7
source share
5 answers

Cause

The catalog_product_flat_% files contain links to existing or removed products.

Decision

Try trimming the tables 'catalog_product_flat_%' (catalog_product_flat_1, catalog_product_flat_2, catalog_product_flat_3, etc.) in the MySQL console or through phpMyAdmin:

 mysql > truncate table ´catalog_product_flat_1´; mysql > truncate table ´catalog_product_flat_2´; mysql > truncate table ´catalog_product_flat_3´; 

Then reindex.

0
source

NOTE. Although the answer below, in my experience, was related to this type of problem, it does not seem to be the cause of the situation that is currently experiencing scams.

Processing means one of two things:

  • Indexes can still be executed, in which case sit back and wait for them to complete. Indexing Magento can take a very long time (for 4500 products, “hours” are possible, depending on the server).

  • The indexer process may have died, leaving delays. Meanwhile, a dead index may be triggered by another user. The most common case is the incorrect cron configuration to run the indexer as root or as a regular user account, and not as the same user used by the website (for example: apache or www ).

All that Processing really means is that "Magento was unable to obtain a lock for these indexer jobs." The first case is trivial and uninteresting. Wait a couple of hours, and if the same indices are still listed as Processing , then you may have a second case.

Check the permissions of the lock files found under var/locks in root purple. Do they own the same user as the web server? If not, and you are absolutely sure that indexes are no longer working , it is safe to remove locks. The next step is to find out why the locks had the wrong permissions in the first place. This is a conversation that could be better with your host if you do not have ssh access.

+6
source

Errors from the indexer will be caught and will not be logged by default. A typical workaround is to use the CLI reindex tool; which will be very verbose with any errors.

Eg.

 php shell/indexer.php --reindex ... 

But if you do not have access to SSH, you can look at the indexer.php file to see how they generate errors, or you can just run shell_exec or exec from a PHP web script that will emulate the CLI.

+1
source

I was unable to reverse the catalog_product_flat indexing process. After spending a day and trying several solutions on the Internet. I was able to solve the problem. Following are the steps.

  • Create a Magento Db clone that is facing an indexing issue.
  • Dump the database into the newly created db.
  • crop the catalog_product_flat_1 table for one store and for several stores there will be several catalog_product_flat_* tables, where * is the store identifier. Here we crop the whole table.
  • specify the executable instance of mangento for the newly created database and configure the database so that the site functions normally.
  • Now run the php document_root/shell/indexer.php --reindex catalog_product_flat or try reindexing it from Admin. php document_root/shell/indexer.php --reindexall to php document_root/shell/indexer.php --reindexall entire process.
0
source

I faced the same problem, creating a new group of customers, I was not able to redefine prices.

Found a solution here http://www.magikcommerce.com/blog/how-to-resolve-magento-reindexing-errors-in-your-magento-store/

Here's the procedure:

  • Locate the var / locks directory and delete all files in this directory. This will clear all locks again for re-indexing.

  • Now log in to your MysQSL / phpMyAdmin to run the following MySQL query (make sure you make a full backup before executing this MySQL query)

    DELETE cpop. * FROM catalog_product_option_price AS cpop INNER JOIN catalog_product_option AS cpo ON cpo.option_id = cpop.option_id WHERE cpo.type = 'checkbox' OR cpo.type = 'radio' OR cpo.type = 'drop_down';

     DELETE cpotp.* FROM catalog_product_option_type_price AS cpotp INNER JOIN catalog_product_option_type_value AS cpotv ON cpotv.option_type_id = cpotp.option_type_id INNER JOIN catalog_product_option AS cpo ON cpotv.option_id = cpo.option_id WHERE cpo.type <> 'checkbox' AND cpo.type <> 'radio' AND cpo.type <> 'drop_down'; 
  • Log in to your Magento admin panel and go to the System tab> index management index index again, and you will notice that such errors do not appear again. You can repeat these steps again if re-indexing stops in the future to resolve Magento ReIndexing .

0
source

All Articles