从上游读取响应头时,nginx recv()失败(104:由对等方重置连接)

时间:2015-04-09 16:03:59

标签: magento nginx crash php

我最近将我的magento从1.5升级到1.9,当我将某个产品添加到购物篮时,我开始收到此错误: 502 Bad Gateway

var / log / 文件夹中没有日志条目: enter image description here

所以,我查看了我的nginx错误,并在 nginx-errors.log 中找到了以下条目:

2015/04/09 10:58:03 [error] 15208#0: *3 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 46.xxx.xxx.xxx, server: dev.my-domain.co.uk, request: "POST /checkout/cart/add/uenc/aHR0cDovL2Rldi5zYWx2ZW8uY28udWsvdGludGktYmF0aC1wYWludGluZy1zb2FwLTcwbWwuaHRtbD9fX19TSUQ9VQ,,/product/15066/form_key/eYLc3lQ35BSrk6Pa/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fcgi-www-data.sock:", host: "dev.my-domain.co.uk", referrer: "http://dev.my-domain.co.uk/tinti-bath-painting-soap-70ml.html"
2015/04/09 11:04:42 [error] 15208#0: *13 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 46.xxx.xxx.xxx, server: dev.my-domain.co.uk, request: "POST /checkout/cart/add/uenc/aHR0cDovL2Rldi5zYWx2ZW8uY28udWsvdGludGktYmF0aC1wYWludGluZy1zb2FwLTcwbWwuaHRtbD9fX19TSUQ9VQ,,/product/15066/form_key/eYLc3lQ35BSrk6Pa/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fcgi-www-data.sock:", host: "dev.my-domain.co.uk", referrer: "http://dev.my-domain.co.uk/tinti-bath-painting-soap-70ml.html"
2015/04/09 11:05:03 [error] 15208#0: *16 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 46.xxx.xxx.xxx, server: dev.my-domain.co.uk, request: "POST /checkout/cart/add/uenc/aHR0cDovL2Rldi5zYWx2ZW8uY28udWsvdGludGktYmF0aC1wYWludGluZy1zb2FwLTcwbWwuaHRtbD9fX19TSUQ9VQ,,/product/15066/form_key/eYLc3lQ35BSrk6Pa/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fcgi-www-data.sock:", host: "dev.my-domain.co.uk", referrer: "http://dev.my-domain.co.uk/tinti-bath-painting-soap-70ml.html"
2015/04/09 11:12:07 [error] 15273#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 46.xxx.xxx.xxx, server: dev.my-domain.co.uk, request: "POST /checkout/cart/add/uenc/aHR0cDovL2Rldi5zYWx2ZW8uY28udWsvdGludGktYmF0aC1wYWludGluZy1zb2FwLTcwbWwuaHRtbD9fX19TSUQ9VQ,,/product/15066/form_key/eYLc3lQ35BSrk6Pa/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fcgi-www-data.sock:", host: "dev.my-domain.co.uk", referrer: "http://dev.my-domain.co.uk/tinti-bath-painting-soap-70ml.html"

我在自定义LEMP堆栈上安装了magento,以下是配置:

当我在升级的magento中将特定产品添加到购物篮时,似乎只会发生此错误,每次发生错误时,我都会看到 core.XXXXX 文件(大约350mb)在 public_html 文件夹中。

知道为什么我的php-fpm会像这样崩溃吗?我怎样才能找到原因并加以解决?

这是我的Linux(CentOS)服务器上的最后一个条目,当我运行 dmesg 命令时:

php-fpm[14862]: segfault at 7fff38236ff8 ip 00000000005c02ba sp 00007fff38237000 error 6 in php-fpm[400000+325000]
php-fpm[15022]: segfault at 7fff38351ff0 ip 00000000005bf6e5 sp 00007fff38351fb0 error 6 in php-fpm[400000+325000]
php-fpm[15021]: segfault at 7fff38351ff0 ip 00000000005bf6e5 sp 00007fff38351fb0 error 6 in php-fpm[400000+325000]
php-fpm[15156]: segfault at 7fff38351ff0 ip 00000000005bf6e5 sp 00007fff38351fb0 error 6 in php-fpm[400000+325000]
php-fpm[15024]: segfault at 7fff38351ff0 ip 00000000005bf6e5 sp 00007fff38351fb0 error 6 in php-fpm[400000+325000]
php-fpm[15223]: segfault at 7fff8d1d5fd8 ip 00000000005c02ba sp 00007fff8d1d5fe0 error 6 in php-fpm[400000+325000]
php-fpm[15222]: segfault at 7fff8d1d5fd8 ip 00000000005c02ba sp 00007fff8d1d5fe0 error 6 in php-fpm[400000+325000]
php-fpm[15225]: segfault at 7fff8d1d5fd8 ip 00000000005c02ba sp 00007fff8d1d5fe0 error 6 in php-fpm[400000+325000]
php-fpm[15227]: segfault at 7fff8d1d5fd8 ip 00000000005c02ba sp 00007fff8d1d5fe0 error 6 in php-fpm[400000+325000]
php-fpm[15362]: segfault at 7fff3118afd0 ip 00000000005c0ace sp 00007fff3118afa0 error 6 in php-fpm[400000+325000]

我用gdb分析了核心转储,这是我在前两帧中看到的:http://pastebin.com/raw.php?i=aPvB1sWv(对我来说没什么意义)......

3 个答案:

答案 0 :(得分:0)

由于PHP 5.5.23补丁(也是5.6.7),我有类似的错误。它在SOAP调用时失败。我发现的唯一解决方法是将php降级到5.5.22。您可以通过放置断点来检测崩溃应用程序的功能。

答案 1 :(得分:0)

从5.6.7降级到5.6.6:

rpm -ivhU --nodeps --force http://rpms.famillecollet.com/enterprise/6.5/php56/x86_64/php-common-5.6.6-1.el6.remi.x86_64.rpm

rpm -ivhU --nodeps --force http://rpms.famillecollet.com/enterprise/6.5/php56/x86_64/php-cli-5.6.6-1.el6.remi.x86_64.rpm

rpm -ivhU --nodeps --force http://rpms.famillecollet.com/enterprise/6.5/php56/x86_64/php-fpm-5.6.6-1.el6.remi.x86_64.rpm

RPM:http://rpms.famillecollet.com/enterprise/6.5/

答案 2 :(得分:0)

您可以检查如果您没有尝试加载模块两次。它发生在xdebug上,有两个文件zend_extension-xdebug.so

这是因为我使用vagrant设置我的机器,默认情况下以前默认配置文件已禁用模块:

20 xdebug.ini:

#zend_module=zdebug.so

所以在我的配置文件中,我很遗憾地将另一个99-xdebug.ini符号链接,这最近发生了变化,默认情况下不启用xdebug。

仍然不知道如何看待它 - 在阅读这篇文章后发现运气:https://bugs.php.net/bug.php?id=65584