Magento 1.9.1.0 前端控制器达到 100 次路由器匹配迭代错误

Magento 1.9.1.0 Front controller reached 100 router match iterations Error

我使用的是 magento 1.9.1.0 - Magento 每天抛出一两次 "Front controller reached 100 router match iterations"

我已将以下代码添加到 app/code/core/Mage/Core/Controller/Varien/Front。php

Mage::log('----Matching routers------------------------------');
Mage::log('Total ' . count($this->_routers) . ': ' . implode(', ', array_keys($this->_routers)));
while (!$request->isDispatched() && $i++<100) {
Mage::log('- Iteration ' . $i);
$requestData = array(
    'path_info' => $request->getPathInfo(),
    'module' => $request->getModuleName(),
    'action' => $request->getActionName(),
    'controller' => $request->getControllerName(),
    'controller_module' => $request->getControllerModule(),
    'route' => $request->getRouteName()
);

$st = '';
foreach ($requestData as $key => $val) {
    $st .= "[{$key}={$val}]";
}
Mage::log('Request: ' . $st);
foreach ($this->_routers as $name => $router) {
    if ($router->match($this->getRequest())) {
        Mage::log('Matched by "' . $name . '" router, class ' . get_class($router));
        break;
    }
}
}

这给了我以下 system.log:

2015-04-30T07:40:14+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T07:40:14+00:00 DEBUG (7): Total 5: admin, standard, cms, neotheme_blog, default
2015-04-30T07:40:14+00:00 DEBUG (7): - Iteration 1
2015-04-30T07:40:14+00:00 DEBUG (7): Request: [path_info=catalog/category/view/id/394][module=][action=][controller=][controller_module=][route=]
2015-04-30T07:40:14+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T07:40:14+00:00 DEBUG (7): Total 5: admin, standard, cms, neotheme_blog, default
2015-04-30T07:40:14+00:00 DEBUG (7): - Iteration 1
2015-04-30T07:40:14+00:00 DEBUG (7): Request: [path_info=catalog/product/view/id/99][module=][action=][controller=][controller_module=][route=]
2015-04-30T07:40:15+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T07:40:15+00:00 DEBUG (7): Total 5: admin, standard, cms, neotheme_blog, default
2015-04-30T07:40:15+00:00 DEBUG (7): - Iteration 1
2015-04-30T07:40:15+00:00 DEBUG (7): Request: [path_info=/onestepcheckout/ajax/set_methods_separate/][module=][action=][controller=][controller_module=][route=]
2015-04-30T07:40:15+00:00 DEBUG (7): Matched by "standard" router, class Mage_Core_Controller_Varien_Router_Standard
2015-04-30T07:40:15+00:00 DEBUG (7): Matched by "standard" router, class Mage_Core_Controller_Varien_Router_Standard
2015-04-30T07:40:20+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T07:40:20+00:00 DEBUG (7): Total 5: admin, standard, cms, neotheme_blog, default
2015-04-30T07:40:20+00:00 DEBUG (7): - Iteration 1
2015-04-30T07:40:20+00:00 DEBUG (7): Request: [path_info=catalog/product/view/id/184/category/457][module=][action=][controller=][controller_module=][route=]
2015-04-30T07:40:24+00:00 DEBUG (7): Matched by "standard" router, class Mage_Core_Controller_Varien_Router_Standard
2015-04-30T07:40:25+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T07:40:25+00:00 DEBUG (7): Total 5: admin, standard, cms, neotheme_blog, default
2015-04-30T07:40:25+00:00 DEBUG (7): - Iteration 1
2015-04-30T07:40:25+00:00 DEBUG (7): Request: [path_info=catalog/category/view/id/356][module=][action=][controller=][controller_module=][route=]
2015-04-30T07:40:25+00:00 DEBUG (7): Matched by "standard" router, class Mage_Core_Controller_Varien_Router_Standard
2015-04-30T07:40:25+00:00 DEBUG (7): Matched by "standard" router, class Mage_Core_Controller_Varien_Router_Standard
2015-04-30T07:40:39+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T07:40:39+00:00 DEBUG (7): Total 5: admin, standard, cms, neotheme_blog, default
2015-04-30T07:40:39+00:00 DEBUG (7): - Iteration 1
2015-04-30T07:40:39+00:00 DEBUG (7): Request: [path_info=/klantenservice/][module=][action=][controller=][controller_module=][route=]
2015-04-30T07:40:39+00:00 DEBUG (7): Matched by "cms" router, class Mage_Cms_Controller_Router
2015-04-30T07:40:39+00:00 DEBUG (7): - Iteration 2
2015-04-30T07:40:39+00:00 DEBUG (7): Request: [path_info=/klantenservice/][module=cms][action=view][controller=page][controller_module=][route=]
2015-04-30T07:40:58+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T07:40:58+00:00 DEBUG (7): Total 5: admin, standard, cms, neotheme_blog, default
2015-04-30T07:40:58+00:00 DEBUG (7): - Iteration 1
2015-04-30T07:40:58+00:00 DEBUG (7): Request: [path_info=/checkout/cart/add/uenc/aHR0cDovL3d3dy5lY2NlbGxlbnRlLm5sL21lbGl0dGEtb25kZXJob3Vkc3NldD9fX19TSUQ9VQ,,/product/99/form_key/7ECJFLVVgHoL7qMo/][module=][action=][controller=][controller_module=][route=]

这种情况一直持续下去。

我该如何解决这个问题?

如果您需要更多信息,请告诉我。

@Christoffer:禁用 nBlog 结果如下 system.log:

2015-04-30T13:04:46+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T13:04:46+00:00 DEBUG (7): Total 4: admin, standard, cms, default
2015-04-30T13:04:46+00:00 DEBUG (7): - Iteration 1
2015-04-30T13:04:46+00:00 DEBUG (7): Request: [path_info=/][module=][action=][controller=][controller_module=][route=]
2015-04-30T13:05:00+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T13:05:00+00:00 DEBUG (7): Total 4: admin, standard, cms, default
2015-04-30T13:05:00+00:00 DEBUG (7): - Iteration 1
2015-04-30T13:05:00+00:00 DEBUG (7): Request: [path_info=/][module=][action=][controller=][controller_module=][route=]
2015-04-30T13:05:11+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T13:05:11+00:00 DEBUG (7): Total 4: admin, standard, cms, default
2015-04-30T13:05:11+00:00 DEBUG (7): - Iteration 1
2015-04-30T13:05:11+00:00 DEBUG (7): Request: [path_info=/api/][module=][action=][controller=][controller_module=][route=]
2015-04-30T13:05:11+00:00 DEBUG (7): Matched by "standard" router, class Mage_Core_Controller_Varien_Router_Standard
2015-04-30T13:05:12+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T13:05:12+00:00 DEBUG (7): Total 4: admin, standard, cms, default
2015-04-30T13:05:12+00:00 DEBUG (7): - Iteration 1
2015-04-30T13:05:12+00:00 DEBUG (7): Request: [path_info=/api/][module=][action=][controller=][controller_module=][route=]
2015-04-30T13:05:12+00:00 DEBUG (7): Matched by "standard" router, class Mage_Core_Controller_Varien_Router_Standard
2015-04-30T13:05:12+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T13:05:12+00:00 DEBUG (7): Total 4: admin, standard, cms, default
2015-04-30T13:05:12+00:00 DEBUG (7): - Iteration 1
2015-04-30T13:05:12+00:00 DEBUG (7): Request: [path_info=/api/index/index/][module=][action=][controller=][controller_module=][route=]
2015-04-30T13:05:12+00:00 DEBUG (7): ----Matching routers------------------------------
2015-04-30T13:05:12+00:00 DEBUG (7): Total 4: admin, standard, cms, default
2015-04-30T13:05:12+00:00 DEBUG (7): - Iteration 1
2015-04-30T13:05:12+00:00 DEBUG (7): Request: [path_info=/api/index/index/][module=][action=][controller=][controller_module=][route=]
2015-04-30T13:05:12+00:00 DEBUG (7): Matched by "standard" router, class Mage_Core_Controller_Varien_Router_Standard
2015-04-30T13:05:12+00:00 DEBUG (7): Matched by "standard" router, class Mage_Core_Controller_Varien_Router_Standard

我会尝试停用 nBlog 扩展程序,如果这样可以解决问题,请查看它的路由代码,看看它出了什么问题。

能否将问题缩小到特定类型的 URL?如果它在博客 URL 上,你就会遇到这个问题,这巩固了我的怀疑。

与核心内容相比,来自第三方扩展的添加路由 class 更有可能是负责的。

编辑

也许这个模块可以帮助你: https://github.com/convenient/magento-ce-ee-config-corruption-bug