Giter Site home page Giter Site logo

Comments (8)

oscarotero avatar oscarotero commented on August 20, 2024

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.

oscarotero avatar oscarotero commented on August 20, 2024

Hi, I've released a new version (3.10.1). Can you test it and telme if it works fine?
Thanks.

from psr7-middlewares.

matthijsthoolen avatar matthijsthoolen commented on August 20, 2024

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.

oscarotero avatar oscarotero commented on August 20, 2024

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.

matthijsthoolen avatar matthijsthoolen commented on August 20, 2024

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.

oscarotero avatar oscarotero commented on August 20, 2024

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.

matthijsthoolen avatar matthijsthoolen commented on August 20, 2024

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.

scheMeZa avatar scheMeZa commented on August 20, 2024

Disabling capture_ajax fixed all my 502 problems.

from psr7-middlewares.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.