The problematic Magento Front controller reached 100 router match iterations exception is not a common issue, but it is certainly a big issue to the usability of a store and can be difficult to solve.
Where is this Magento exception thrown?
In app/code/core/Mage/Core/Controller/Varien/Front.php inside of the dispatch() function. The following code snippet will give you an idea:
1 2 3 4 5 6 7 8 9 10 |
while (!$request->isDispatched() && $i++<100) { foreach ($this->_routers as $router) { if ($router->match($this->getRequest())) { break; } } } Varien_Profiler::stop('mage::dispatch::routers_match'); if ($i>100) { Mage::throwException('Front controller reached 100 router match iterations'); } |
When is this exception thrown?
This exception is thrown whenever Magento cannot find a proper route for a request. In general, it should always be able to match a request with the router that handles 404 Not Found requests. As a result, in practice, this exception is only triggered when Magento has properly failed to generate routers or the cache has become corrupted.
How to solve this issue?
In our experience, there are two primary causes:
- CMS Module Disabled – The CMS module handles 404 not found requests which is the fallback router. As a result, if this module is disabled, then no router may be found. To resolve, simply enable the CMS module
- Cache is Corrupted – It could be the Magento cache became corrupted. In this case, the list of routers never gets loaded since it tries to load from cache and the cache does not have this data. As a result, fully flushing the Magento cache will resolve this issue.