随机引发内部服务器错误500.如何调试?

时间:2014-08-10 18:21:30

标签: ajax apache zend-framework nginx

最近我将我的zend应用程序从简单托管移动到azure,配置为通过nginx-> haproxy-> apache链处理请求。 nginx,haproxy和apache是​​docker容器。加载应用程序时,会向不同的控制器发出20-30个AJAX请求。这是我在控制器中使用的常用init方法:

public function init()
{
    $this->sa = System_Auth::getInstance();
    $this->data = $this->getRequest()->getParams();
    $this->current = $this->sa->getCurrent();
    $this->data['customer_id'] = $this->current->customer ? $this->current->customer->id : $this->current->id;

    $this->_helper->contextSwitch()
        ->addActionContext('test', 'json')
        ->setAutoJsonSerialization(true)
        ->initContext();
    $this->_helper->layout()->disableLayout();
    $this->_helper->viewRenderer->setNoRender(true);
}

所以没有什么有趣的东西。但每次我加载应用程序约3或4个AJAX请求返回500错误。每次不同的请求失败,500错误。 Apache和nginx日志为空。并且我无法转储传递给控制器​​的数据,因为甚至无法调用失败的控制器。 有人有想法吗?

1 个答案:

答案 0 :(得分:0)

OK quys,最后它被修复了。

发生的地方: HaProxy和循环mariaDB集群Master-Master-Master

发生了什么: 有些查询每次都会随机失败

<强>为什么: 在三个mysql服务器之一上找到了sql_mode = only_full_group_by

之前我在所有服务器上清除了sql_mode变量,但稍后在重新启动其中一台服务器时恢复了该变量。并且变量不可复制,您应该在每个服务器上手动更改它们

*有可能但我现在不知道

相关问题