Javaexercise.com

What Is The Err_http2_protocol_error, And How To Handle It?

While working on a web application, you may face the net::ERR_HTTP2_PROTOCOL_ERROR 200 error. It is an error triggered by browsers such as  Google Chrome mostly.

This error may come up due to several reasons such as no disk space left on the webserver or using the Nginx server. 

It can happen when you make HTTP calls from your code using ReactJS, .Net, NodeJs, etc.

1. Solution err_http2_protocol_error : Low Disk Space

This is one of the basic reasons to get this error. You must firsts check the disk space of your webserver. If it is running on low space you will get err_http2_protocol_error during HTTP calls on the browser.

Since no space is left out in the disk the error won’t be logged anywhere in the disk.

So, you first clean the disk space of your web server and check if this resolves the issue.

The webservers like Nginx, Apache usually drops the request after the first chunk is sent.

2. Solution err_http2_protocol_error: Gzip double compression

If you are working with Node.JS and Nginx server, then It may be possible that the files like CSS, JS, etc are getting double compressed, and due to which err_http2_protocol_error is raised.

The NodeJS does the first compression for the static files, and then the Nginx also does Gzip conversion. 

So, you first turn off the gzip compression on the Nginx config as shown below. The gzip compression must happen only once either client or server-side.

 server {
  ...
  ...
  gzip off;
  proxy_max_temp_file_size 0;
  location / {
    proxy_pass http://127.0.0.1:8080/;
  ....

Also, increase the value of http2_max_field_size and http2_max_header_size parameters because it may also cause the header size issue.

http2_max_field_size 64k;
http2_max_header_size 512k;

3. Solution err_http2_protocol_error: Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR after upgrading to VS 2019 16.10.0 (and 16.10.1)

The issue generally comes due to ASP.Net 3.1 + React JS app after updating windows.

If you are working with ASP and React both then there may be chances you get this error due to some compatibility issues.

Although, Microsoft has resolved this issue with its new updates. You can get the detailed info here. Microsoft Developer Community

So, you must either uninstall a recent Windows patch, KB5003637 to resolve the issue, or just upgrade to the latest Windows version.

Conclusion

Here, we discussed the err_http2_protocol_error error in web browsers and web servers. This error can come with several reasons such as low disk space or ASP with ReactJs due to compatibility issues.

We discussed the possible solutions as well. So, you can get help to save time.

Upper sidebar
Sidebar bottom