What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

前端 未结 22 2573
無奈伤痛
無奈伤痛 2020-12-01 02:24

I\'m currently working on a website, which triggers a net::ERR_HTTP2_PROTOCOL_ERROR 200 error on Google Chrome. I\'m not sure exactly what can provoke this erro

相关标签:
22条回答
  • 2020-12-01 02:57

    This happened to me when I registered a new domain name, e.g., "new" for example.com (new.example.com). The name could not be resolved temporarily in my location for a couple of hours, while it could be resolved abroad. So I used a proxy to test the website where I saw net::ERR_HTTP2_PROTOCOL_ERROR in chrome console for some AJAX posts. Hours later, when the name could be resloved locally, those error just dissappeared.

    I think the reason for that error is those AJAX requests were not redirected by my proxy, it just visit a website which had not been resolved by my local DNS resolver.

    0 讨论(0)
  • 2020-12-01 02:58

    I encountered this because the http2 server closed the connection when sending a big response to the Chrome.

    Why? Because it is just a setting of the http2 server, named WriteTimeout.

    0 讨论(0)
  • 2020-12-01 03:00

    In my case I have a kubernetes cluster with nginx ingress controller and nginx+php-fpm to handle drupal instance.

    I notice this issue on one of my page, where my pictures was not loaded in chrome. After investigation I discovered that modsecurity module enabled in my nginx ingress somehow produce this issue. Not fully know why, but after disabling it, all pages are loaded fine.

    Best Regards.

    0 讨论(0)
  • 2020-12-01 03:02

    I faced this error several times and, it was due to transferring large resources(larger than 3MB) from server to client.

    0 讨论(0)
  • 2020-12-01 03:03

    This error is currently being fixed: https://chromium-review.googlesource.com/c/chromium/src/+/2001234

    But it helped me, changing nginx settings:

    • turning on gzip;
    • add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
    • expires off;

    In my case, Nginx acts as a reverse proxy for Node.js application.

    0 讨论(0)
  • 2020-12-01 03:03

    For my situation this error was caused by having circular references in json sent from the server when using an ORM for parent/child relationships. So the quick and easy solution was

    JsonConvert.SerializeObject(myObject, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore })
    

    The better solution is to create DTOs that do not contain the references on both sides (parent/child).

    0 讨论(0)
提交回复
热议问题