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

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

问题描述

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

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.

这是在从 Magento 1.5.0.1 升级到 1.5.1.0 之后开始的.如果我手动清除 var/cache/目录,我将再次启动并运行.

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-----------------------

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

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

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.

调试代码输出的正常路由器是:共 7 个:admin、standard、cms、amshopby、fishpig_wordpress、seosuite、default

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

发生错误时,它们已更改为:共 3 个:管理员、标准、默认

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

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

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.

推荐答案

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

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

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

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

更新:MAGENTO 已将我的答案用作补丁

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-损坏错误

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

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;
 }

更新为在 vanilla 1.5 上测试

Updated to test on vanilla 1.5

我刚刚在 1.5 的 vanilla 安装上运行了复制脚本.除了 CONFIG 缓存之外的所有缓存都被禁用了.

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

它没有像 1.13 那样产生 100 router 错误,但它确实破坏了网站,并且显示的所有主页都是白屏.

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.

原因是当我们在寻找控制器和动作时,我们匹配的是Mage_Core_IndexController::indexAction 而不是Mage_Cms_IndexController::indexAction.

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 是一个空函数,完美地解释了白页.

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

_useCache = false 放入 Mage_Core_Model_Config 时,我无法再复制此错误.

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

我相信您的 Magento 站点的独特配置可能会导致它完全无法匹配控制器,而不是退回到此 Mage_Core_IndexController 操作?

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天全站免登陆