Comments (8)
Thank you. I suspect the problem is in debugBar (in 3.10 the data is sent in the http headers in ajax requests, as explained here http://phpdebugbar.com/docs/ajax-and-stack.html#ajax ) but I'll take a look.
from psr7-middlewares.
Hi, I've released a new version (3.10.1). Can you test it and telme if it works fine?
Thanks.
from psr7-middlewares.
Thank you for the fix. But I still get the same error.
When I disable the debugbar middleware it's working again.
I tried to disable the collector but that isn't working either.
this is my code for the initialization of the debugbar
$debugbar = new \DebugBar\StandardDebugBar();
// tried this as a solution but wasn't working
// if ($_SERVER['REQUEST_METHOD'] != 'GET')
// $debugbar->sendDataInHeaders();
$debugbar->addCollector(new \DebugBar\Bridge\MonologCollector(Log::getLogger()));
$twig = new DebugBar\Bridge\Twig\TraceableTwigEnvironment($twig);
$debugbar->addCollector(new DebugBar\Bridge\Twig\TwigCollector($twig));
from psr7-middlewares.
I guess this is a problem with the data send in headers. I have to provide an option to disable this feature, but I'd like to know the origin of this problem. Maybe is because there's too much data? Or because a specific collector? Can you check the response receives by the browser and see the body and headers send?
from psr7-middlewares.
I don't think there is to much data because it seems to happen with every ajax request.
For one of the requests this is the header for version 3.9.3 (response header)
HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Tue, 29 Dec 2015 20:34:26 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
X-Powered-By: PHP/5.5.9-1ubuntu4.14
Expires: -1
Cache-Control: no-cache, no-store, max-age=0
Pragma: no-cache
Set-Cookie: sso_PorSi_c=1; path=/admin/
Set-Cookie: sso_PorSi_s=zC0PRCJjuTRJXlH49JNTrTxOZu2fJQDmrVgf2IAIn8aD0Pxpv-X8CEGCA_s9dV3TqpCFjIJPU2snuKXzCoaiAT6oB8S-04VoHc43bJpgJlu_YiIKkO69cp7JchZg8lzXki19iLaYwoi-153S7KQ7gvr-ZFV_PY8sNooxg2vUJfnOzQutN-qqGI635jU81M6cVUpNN-4YKkNTeOfV3dc09w; path=/admin/; HttpOnly
Set-Cookie: sso_PorSi_v=Ktk0M8t74SKpayVIKamJETFeeYU; path=/admin/; HttpOnly
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Content-Length: 1724
Indeed when I enable sendDataInHeader(); for none GET request types I get the same 502 error.
When I set a storage the problem seems to be gone.
So it looks like that indeed there is to much data. So I searched on Google and found this: http://shiki.me/blog/firephp-on-nginx-502-bad-gateway/ and my server is also on nginx.
It would be nice if we could indeed disable this feature, or disable debugbar completely for ajax requests maybe?
from psr7-middlewares.
Ok, the version 3.10.2 has this feature disabled by default but you can enable it with captureAjax()
option.
I'm intrigued with this issue, so if you find a way to solve it, please, let me know.
(For example, by default, the max lenght of each header is 4Mb, maybe too much.)
from psr7-middlewares.
Yes it's working now. Thanks!
I already tried to find a fix, but didn't find anything useful. But I will let you know if I found something!
from psr7-middlewares.
Disabling capture_ajax fixed all my 502 problems.
from psr7-middlewares.
Related Issues (20)
- Error handler middleware assumes stream immutability HOT 1
- Does this project follow semver? HOT 2
- HTTPS terminated at load balancer HOT 9
- Custom Middleware HOT 2
- Closed
- Expose Middleware HOT 2
- JSON Schema incompatible with Slim Framework HOT 5
- Defective unit tests not marked as risky. HOT 1
- JsonDecoder HOT 4
- Csrf middleware is not fully PHP 5 compatible HOT 5
- Slim v3 and DigestAuth middleware is endlessly looping the password dialog. HOT 3
- Question about Cache Middleware HOT 3
- AuraRouter curl stuck at 404 not found. HOT 3
- Adding extra slashes after domain name in url allows you to bypass JWT Authentication
- MiddlewareInterface HOT 2
- https middleware HOT 10
- BlockSpam default path to spammers.txt is wrong HOT 1
- FormatNegotiator - hard coded priorities? HOT 4
- apply http-interop/http-middleware compatibiity HOT 6
- Firewall middleware needs ClientIp executed before HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psr7-middlewares.