I've created a Magento instance via command line and added a few products. Right after, started the re-index proccess for every indexes. The current situation is that all indexes have status pending/processing. This situation brings me a few questions:
I've already executed php shell/indexer.php reindexall
but nothing changed. And, if I execute php shell/indexer.php --status
all indexes report as 'Pending'.
Thanks
First: You'll want to get your terminology straight. (it can be a little confusing). A Magento index has one of three statuses.
pending
working
require_reindex
You can see the constants for these statuses here
const STATUS_RUNNING = 'working';
const STATUS_PENDING = 'pending';
const STATUS_REQUIRE_REINDEX = 'require_reindex';
This can be confusing because the image Magento uses to represent these statuses use different terminology.
That is, when an index has a status of pending
, Magento's UI represents this as Ready
. When an index has a status of working
, Magento's UI represents this as Processing
, etc.
Further confusing things, the indexer.php
command does not use this terminology -- instead it uses terms closer to the actual status
Pending
Require Reindex
Running
So, when you're saying Pending/Processing above, it's not clear what state your system is in.
Second: PHP does not have a built in queuing system — that means each index runs in an individual PHP process. This also means Magento and PHP have no (easy, reliable) way to determine if an index process is running. In order to implement the STATUS_RUNNING
/Working
/Running
status, Magento uses lock files to keep track of an index's status. These lock files are located in
var/locks/index_process_*
When an index is "stuck" in STATUS_RUNNING
/Working
/Running
for longer than you'd expect, it's usually because
A indexer request quit half way though, and failed to clean up its log files
The permissions of the files in var/locks/index_process_*
are such that PHP can't write the files
Re: #2 -- If you're in the habit of using the command line indexer, you can often end up creating files that Magento, when running from the web-server/web-admin, won't be able to edit or delete. Deleting these files and then reindexing is often the best way to fix this problem.
in var/locks folder delete the .lock file which was created.
This will e the first step in solving.
Also check if php execution time and memory limit are not the reason for indexing script not completing its execution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With