Magento “Front controller reached 100 router match iterations” error

后端 未结 10 2445
失恋的感觉
失恋的感觉 2020-12-05 04:54

My site is going down once or twice a day when it starts throwing the exception \"Front controller reached 100 router match iterations\". Once this happens access to the adm

10条回答
  •  借酒劲吻你
    2020-12-05 05:12

    UPDATE 2: I have some further changes which should help prevent a different cause of the 100 router match iterations

    https://github.com/convenient/magento-ce-ee-config-corruption-bug#update-2-further-improvements

    ====================================================================

    UPDATE: MAGENTO HAVE USED MY ANSWER AS A PATCH

    https://github.com/convenient/magento-ce-ee-config-corruption-bug#update-good-news-a-patch-from-magento

    ====================================================================

    I've recently spent quite some time looking into this bug. I've written up my full findings, explanation and replication here.

    https://github.com/convenient/magento-ce-ee-config-corruption-bug

    However, for the short answer. This appears to be a Magento bug which can be corrected by overriding Mage_Core_Model_Config::init with the following:

     public function init($options=array())
     {
         $this->setCacheChecksum(null);
         $this->_cacheLoadedSections = array();
         $this->setOptions($options);
         $this->loadBase();
    
         $cacheLoad = $this->loadModulesCache();
         if ($cacheLoad) {
             return $this;
         }
         //100 Router Fix Start
         $this->_useCache = false;
         //100 Router Fix End
         $this->loadModules();
         $this->loadDb();
         $this->saveCache();
         return $this;
     }
    

    EDIT: Updated to test on vanilla 1.5

    I just ran the replication script on a vanilla install of 1.5. Which had all caches except for the CONFIG cache disabled.

    It did not produce the 100 router error as it does on 1.13, but it did break the website and all the homepage displayed was a white screen.

    The cause was that when we were looking for a controller and action we were matched with Mage_Core_IndexController::indexAction instead of Mage_Cms_IndexController::indexAction.

    class Mage_Core_IndexController extends Mage_Core_Controller_Front_Action {
    
        function indexAction()
        {
    
        }
    }
    

    Mage_Core_IndexController::indexAction is an empty function, and explains the white page perfectly.

    I can no longer replicate this error when placing _useCache = false into Mage_Core_Model_Config.

    I believe that maybe your Magento sites unique configuration might cause it to completely fail to match a controller, as opposed to falling back to this Mage_Core_IndexController action?

提交回复
热议问题