Magento – Indexer model is not defined

indexing

I'm using Magento CE 1.7.
here is the error I get suddenly, each time I access the "index management" screen (so I canot access it anymore), or each time I try to update a product (so i can't save product anymore) and each time I try to enable/disable a module from the back end:

Indexer model is not defined. 

Trace:
#0 /home/webscoot/www/app/code/core/Mage/Index/Model/Process.php(306): Mage::throwException('Indexer model is not defined.')
#1 /home/webscoot/www/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php(72): Mage_Index_Model_Process->getIndexer()
#2 /home/webscoot/www/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(534): Mage_Index_Block_Adminhtml_Process_Grid->_afterLoadCollection()
#3 /home/webscoot/www/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php(62): Mage_Adminhtml_Block_Widget_Grid->_prepareCollection()
#4 /home/webscoot/www/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(626): Mage_Index_Block_Adminhtml_Process_Grid->_prepareCollection()
#5 /home/webscoot/www/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(632): Mage_Adminhtml_Block_Widget_Grid->_prepareGrid()
#6 /home/webscoot/www/app/code/core/Mage/Core/Block/Abstract.php(862): Mage_Adminhtml_Block_Widget_Grid->_beforeToHtml()
#7 /home/webscoot/www/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#8 /home/webscoot/www/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('grid', true)
#9 /home/webscoot/www/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php(77): Mage_Core_Block_Abstract->getChildHtml('grid')
#10 /home/webscoot/www/app/design/adminhtml/base/default/template/widget/grid/container.phtml(36): Mage_Adminhtml_Block_Widget_Grid_Container->getGridHtml()
#11 /home/webscoot/www/app/code/core/Mage/Core/Block/Template.php(241): include('/home/webscoot/www/app/design/adminhtml/base/default/template/widget/grid/container.phtml')
#12 /home/webscoot/www/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/base/default/template/widget/grid/container.phtml')
#13 /home/webscoot/www/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#14 /home/webscoot/www/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#15 /home/webscoot/www/app/code/core/Mage/Adminhtml/Block/Widget/Container.php(308): Mage_Adminhtml_Block_Template->_toHtml()
#16 /home/webscoot/www/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Adminhtml_Block_Widget_Container->_toHtml()
#17 /home/webscoot/www/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()

etc

Best Answer

Most probably you have a declared indexer that does not have a model associated to it. There is also the chance that if you have the cache enabled, this cache can be corrupted. (but I doubt it). Just to make sure first you clear the contents of var/cache.
If that does not work, and probably won't here is how the indexes work. An index is defined in the config.xml of a module. Here is an example.

<index>
   <indexer>
        <catalog_product_attribute>
            <model>catalog/product_indexer_eav</model>
        </catalog_product_attribute> 
         ..............
    </indexer>
</index>

This declares an index with code catalog_product_attribute. As you can see there is a model tag inside it. That is the model that should handle the index. This is what is missing for one of your indexes.
To see which one is wrong do this:

In the method Mage_Index_Model_Process::getIndexer(), above the line:

Mage::throwException(Mage::helper('index')->__('Indexer model is not defined.')); 

Add this debug line:

echo $code;exit;

and try to access the index grid again. This should show you the index with problems. Check the config.xml files for a tag with the same name as the value you get from the code above. Look specially in the extensions that you recently installed.

Related Topic