php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69777 502 Bad Gateway when getting response
Submitted: 2015-06-08 21:03 UTC Modified: 2021-10-10 04:22 UTC
Votes:6
Avg. Score:4.3 ± 0.9
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:2 (40.0%)
From: sb at firstvector dot org Assigned: cmb (profile)
Status: No Feedback Package: FPM related
PHP Version: 5.6.9, 5.6.10, 5.6.11, 5.6.12 OS: OS X Yosemite 10.10.3 (14D136)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
45 + 30 = ?
Subscribe to this entry?

 
 [2015-06-08 21:03 UTC] sb at firstvector dot org
Description:
------------
Using PHP-FPM 5.6.9 I've getting the error while working with cURL, for example. When I commented the code that does remote requests then everything's fine, otherwise error log contains an errors like:

upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: unga.loc, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "unga.loc", referrer: "http://unga.loc/content/test-project-4"

For solving this problem I've tried to use UNIX socket and TCP connection - no result. So, I've think that is an error.

Used software:
nginx 1.8.0 (also tested on 1.6.3)
php-fpm 5.6.9 (works fine on 5.6.7)

Test script:
---------------
// Execution of this (and similar) code will ends by 502 error.
$ch = curl_init('https://php.net');
curl_setopt_array($ch, [
  CURLOPT_HTTPGET => true,
  CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-07 07:31 UTC] sb at firstvector dot org
-PHP Version: 5.6.9 +PHP Version: 5.6.9, 5.6.10
 [2015-07-07 07:31 UTC] sb at firstvector dot org
Bug still reproduced on 5.6.10
 [2015-07-22 10:00 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2015-07-22 10:00 UTC] mike@php.net
Any hints in the (error) logs?
 [2015-08-02 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2015-08-19 13:22 UTC] sb at firstvector dot org
-Status: No Feedback +Status: Closed -PHP Version: 5.6.9, 5.6.10 +PHP Version: 5.6.9, 5.6.10, 5.6.11, 5.6.12
 [2015-08-19 13:22 UTC] sb at firstvector dot org
NGINX error log message:
2015/08/19 16:18:58 [error] 39704#0: *3 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: unga.loc, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "unga.loc", referrer: "http://unga.loc/user"

PHP-FPM log contains:
[19-Aug-2015 16:20:42] WARNING: [pool www] child 39743 exited on signal 11 (SIGSEGV) after 485.838010 seconds from start
[19-Aug-2015 16:20:42] NOTICE: [pool www] child 39826 started
 [2015-08-19 13:30 UTC] sb at firstvector dot org
-Status: Closed +Status: Open
 [2015-08-19 13:30 UTC] sb at firstvector dot org
Bug still reproduced
 [2021-09-29 16:42 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-09-29 16:42 UTC] cmb@php.net
> WARNING: [pool www] child 39743 exited on signal 11 (SIGSEGV)
> after 485.838010 seconds from start

Obviously a segfault, so we would need a stack backtrace[1], if
that still happens with any of the actively supported PHP
versions[2].

[1] <https://bugs.php.net/bugs-generating-backtrace.php>
[2] <https://www.php.net/supported-versions.php>
 [2021-10-10 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 10:01:28 2024 UTC