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

fdx2calv  于 2022-10-06  发布在  Nginx
关注(0)|答案(3)|浏览(244)

我最近将我的Magento从1.5升级到1.9,每当我将某个产品添加到篮子中时,我开始收到这个错误:502 Bad Gateway

  • var/log/*文件夹中没有日志条目:

因此,我查看了我的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的购物篮中时,才会出现此错误,并且每次出现错误时,我都会在public_html文件夹中看到一个core.XXXXX文件(大约350 MB)。

你知道为什么我的php-fpm会这样崩溃吗?我如何才能找到原因并修复它?

当我运行dMesg命令时,以下是我的Linux(CentOS)服务器上的最后几个条目:

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(对我来说没有多大意义)……

3vpjnl9f

3vpjnl9f1#

我有类似的错误,因为PHP 5.5.23补丁(也是5.6.7)。在调用SOAP时失败。我发现的唯一解决办法是将php降级到5.5.22。您可以通过设置断点来检测导致应用程序崩溃的函数。

66bbxpm5

66bbxpm52#

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

zi8p0yeb

zi8p0yeb3#

如果不尝试两次加载模块,则可以进行检查。这发生在我的XDEBUG上,得到了两个zend_extension-xdebug.so文件

这是因为我使用漫游来设置我的机器,而以前的默认配置文件默认禁用了模块:

20-xdebug.ini:


# zend_module=zdebug.so

因此,在我的配置文件中,我符号链接了另一个99-xdebug.ini,不幸的是,这是最近更改的,并且默认情况下启用了非xdebug。

还是不知道怎么看--读了这篇帖子后幸运地发现的:https://bugs.php.net/bug.php?id=65584

相关问题