Magento“前端控制器达到100路由器匹配迭代”错误 [英] Magento "Front controller reached 100 router match iterations" error

查看:272
本文介绍了Magento“前端控制器达到100路由器匹配迭代”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站每天下来一次或两次,当它开始抛出异常前端控制器达到100路由器匹配迭代。一旦发生这种情况,访问管理员和前端就会消失。我刚刚留下了一个错误页面。



从Magento 1.5.0.1升级到1.5.1.0开始。如果我手动清除var / cache /目录,我已经启动并再次运行。



我已经把它从这个中删除了。在有限的搜索结果中,我发现没有任何帮助我解决这个问题。



不知道为什么会发生这种情况以及如何解决这个问题。 / p>

- 更新-----------------------



使用Andrey Tserkus的有用答案中提供的调试代码,我能够确定错误是由我的一些路由器消失引起的。



调试代码输出的正常路由器为:
总计7:admin,standard,cms,amshopby,fishpig_wordpress,seosuite,default



发生错误时,它们已更改为:
总共3:admin,standard,default



发生这种情况时似乎缺少的路由导致每个页面请求的代码迭代到100。我会进一步调查这个情况。

解决方案

更新2:我有一些进一步的变化,应该有助于防止不同的原因100路由器匹配迭代



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



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



更新:MAGENTO使用我的答案作为贴纸



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



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



我最近花了很多钱时间研究这个bug。我已经写了我的完整发现,解释和复制 here



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



但是,简短的答案。这似乎是一个Magento错误,可以通过使用以下内容覆盖 Mage_Core_Model_Config :: init 来更正:

  public function init($ options = array())
{
$ this-> setCacheChecksum(null);
$ this-> _cacheLoadedSections = array();
$ this-> setOptions($ options);
$ this-> loadBase();

$ cacheLoad = $ this-> loadModulesCache();
if($ cacheLoad){
return $ this;
}
// 100路由器修复开始
$ this-> _useCache = false;
// 100路由器修复结束
$ this-> loadModules();
$ this-> loadDb();
$ this-> saveCache();
return $ this;
}

编辑:更新以测试香草1.5



我只是在1.5版本的vanilla安装上运行复制脚本。除了 CONFIG 缓存禁用之外,所有缓存都有缓存。



它没有生成 100路由器错误,因为它在1.13,但它确实打破了网站,所有显示的主页是一个白色的屏幕。



原因是当我们寻找一个控制器和动作时,我们与 Mage_Core_IndexController :: indexAction 而不是 Mage_Cms_IndexController :: indexAction

  class Mage_Core_IndexController extends Mage_Core_Controller_Front_Action {

function indexAction()
{

}
}

Mage_Core_IndexController :: indexAction 是一个空白的功能,完美地解释了白页。将 _useCache = false 放入 Mage_Core_Model_Config



code>。



我相信,也许您的Magento网站的独特配置可能会导致它完全不能匹配一个控制器,而不是回到这个 Mage_Core_IndexController action?


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 admin and frontend is gone. I am just left with an error page.

This started after upgrading from Magento 1.5.0.1 to 1.5.1.0. If I manually clear the var/cache/ directory I am up and running again.

I have googled the heck out of this one. In the limited search results I have found nothing has helped me with resolving this.

Any insight into why this may be happening and how it could be resolved would be appreciated.

--update-----------------------

Using the debugging code provided in the helpful answer from, Andrey Tserkus, I was able to determine that the error is caused by some of my routers disappearing.

The normal routers output by the debug code are: Total 7: admin, standard, cms, amshopby, fishpig_wordpress, seosuite, default

When the error occurs they have changed to: Total 3: admin, standard, default

When this happens it seems the missing routes causes the code to iterate to 100 for every page request. I will investigate this condition further.

解决方案

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?

这篇关于Magento“前端控制器达到100路由器匹配迭代”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆