4

I am running Magento EE 1.13.1.0 I set all the index options in System=>Configuration=>Advanced=>Index Management to "Update when scheduled".

When I run

$ php -f indexer.php mode
Product Flat Data:                  unknown
Stock Status:                       unknown
Catalog product price:              unknown
Category URL Rewrites:              unknown
Product URL Rewrites:               unknown
URL Redirects:                      unknown
Catalog Category/Product Index:     unknown
Catalog Search Index:               unknown
Tag Aggregation Data:               Manual Update
Product Attributes:                 Manual Update

What is the meaning of the "unknown" mode and how can I repair?

2

Unknown is the default status hardcoded in the indexer.php shell script:

        foreach ($processes as $process) {
            /* @var $process Mage_Index_Model_Process */
            $status = 'unknown';
            if ($this->getArg('status')) {
                switch ($process->getStatus()) {
                    case Mage_Index_Model_Process::STATUS_PENDING:
                        $status = 'Pending';
                        break;
                    case Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX:
                        $status = 'Require Reindex';
                        break;
                    case Mage_Index_Model_Process::STATUS_RUNNING:
                        $status = 'Running';
                        break;
                    default:
                        $status = 'Ready';
                        break;
                }
            } else {
                switch ($process->getMode()) {
                    case Mage_Index_Model_Process::MODE_SCHEDULE:
                        $status = 'Update by schedule';
                        break;
                    case Mage_Index_Model_Process::MODE_REAL_TIME:
                        $status = 'Update on Save';
                        break;
                    case Mage_Index_Model_Process::MODE_MANUAL:
                        $status = 'Manual Update';
                        break;
                }
            }
            echo sprintf('%-35s ', $process->getIndexer()->getName() . ':') . $status ."\n";

        }

As you can see from the code this default status is displayed when the indexer mode is not one of the following:

  • Mage_Index_Model_Process::MODE_SCHEDULE
  • Mage_Index_Model_Process::MODE_REAL_TIME
  • Mage_Index_Model_Process::MODE_MANUAL

However, Magento does not define any other mode out of the box so in theory, you should never get unknown mode.

What you can do to debug it:

Add a default case to display what mode your index is on to find out what's going on:

Replace the following code:

            switch ($process->getMode()) {
                case Mage_Index_Model_Process::MODE_SCHEDULE:
                    $status = 'Update by schedule';
                    break;
                case Mage_Index_Model_Process::MODE_REAL_TIME:
                    $status = 'Update on Save';
                    break;
                case Mage_Index_Model_Process::MODE_MANUAL:
                    $status = 'Manual Update';
                    break;
            }

With:

            switch ($process->getMode()) {
                case Mage_Index_Model_Process::MODE_SCHEDULE:
                    $status = 'Update by schedule';
                    break;
                case Mage_Index_Model_Process::MODE_REAL_TIME:
                    $status = 'Update on Save';
                    break;
                case Mage_Index_Model_Process::MODE_MANUAL:
                    $status = 'Manual Update';
                    break;
                default:
                    $status = $process->getMode();
                    break;
            }
0

I think this is normal behaviour of Magento EE so there is nothing to repair. I observe the exact same output in an installation of Magento EE v. 1.14.2.3.

Indexers are printed by iterating over $processes in indexer.php. It is a collection of type Enterprise_Index_Model_Resource_Process_Collection. Have a look into this class: in method initializeSelect this collection is built by unioning $oldIndexersSelect and $newIndexersSelect. For $newIndexersSelect several fields are set to empty constants:

                ...
                'started_at' => new Zend_Db_Expr('NULL'),
                'ended_at' => new Zend_Db_Expr('NULL'),
                'mode' => new Zend_Db_Expr('NULL'),
                'events' => new Zend_Db_Expr('0'),
                ...

So this is why indexer.php displays mode "unknown" and why in Index Management the column "mode" is emtpy for the same indexers. I assume this is normal behaviour which results from Magento EE having several different indexer implementations which got integrated over the years.

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.