DEV Community

upordown.online
upordown.online

Posted on Edited on

How to fix ERR_HTTP2_PROTOCOL_ERROR in Chrome (what actually causes it, and how to find it on your server)

Uptime monitoring from outside your own infrastructure that alerts you the minute your site goes down — upordown.online

ERR_HTTP2_PROTOCOL_ERROR is Chrome's way of saying "the server and I were talking HTTP/2, and something in the conversation broke the rules". The page may fail completely, load without styles, or fail only on one large file or one API call.

It's confusing because the same message covers problems on both ends. Below is the quick path for visitors, then the much more common server-side causes and how to confirm each one.

If you're a visitor

Try these in order. Each takes under a minute.

  1. Open the page in an Incognito window. If it works there, an extension or cached data is the cause. Disable extensions one at a time (ad blockers and privacy extensions that rewrite requests are the usual suspects).
  2. Clear cached data for that site only. Click the padlock or tune icon in the address bar, then "Site settings", then "Delete data".
  3. Turn off HTTPS scanning in your antivirus. Several antivirus and "web protection" products intercept HTTPS connections and re-encrypt them. Some of them handle HTTP/2 badly. If disabling the HTTPS scanning feature fixes it, that's your answer.
  4. Try another network. A corporate proxy or a captive Wi-Fi portal in the middle can break HTTP/2 the same way.
  5. Update Chrome. Older builds had real HTTP/2 bugs, and updating costs nothing.

If the error happens in every browser, on every network, for other people too, it's the server. The rest of this post is for whoever runs it.

If you run the site: reproduce it outside the browser first

Use curl with HTTP/2 forced, and watch where the transfer stops:

curl -v --http2 -o /dev/null https://example.com/path/that/fails
Enter fullscreen mode Exit fullscreen mode

You're looking for lines like HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1) or INTERNAL_ERROR. Then run the same request with --http1.1. If HTTP/1.1 works and HTTP/2 doesn't, you've confirmed it's an HTTP/2 framing problem, not the app being down.

Chrome can also log the session in detail: open chrome://net-export, start logging, reproduce the error, stop, and load the file in the netlog viewer. Search for HTTP2_SESSION_RECV_RST_STREAM or HTTP2_STREAM_ERROR to see which side reset the stream and why.

Seeing ERR_HTTP2_PROTOCOL_ERROR only for some visitors? upordown.online checks your site from outside, so you can tell a local browser issue from a server-side HTTP/2 failure.

The usual server-side causes

1. The response was cut off partway through

This is the most common one. The server announced a Content-Length, then sent fewer bytes, or the stream simply ended. In HTTP/1.1 the browser might shrug and show a partial file; in HTTP/2 it's a protocol error.

Things that truncate responses:

  • A full disk. Nginx buffers large upstream responses to temporary files. If the disk is full, the buffer write fails and the response is cut off. Check df -h and look in the Nginx error log for No space left on device.
  • An unwritable temp directory. Same mechanism: if the Nginx worker user can't write to proxy_temp_path (often /var/lib/nginx/proxy or /var/cache/nginx/proxy_temp), responses larger than the in-memory buffers fail. The error log says open() ... failed (13: Permission denied) while reading upstream. Fix ownership, or set proxy_max_temp_file_size 0; to stream instead of buffering to disk.
  • An app that sets Content-Length and then sends something else. Common after compression middleware is added to an app that already computed the length, or when a response body is modified after headers are sent.
  • Timeouts that kill long responses. A slow file download or server-sent event stream hitting a proxy's read or send timeout ends abruptly.

2. A header that is legal in HTTP/1.1 but not in HTTP/2

HTTP/2 forbids connection-specific headers: Connection, Keep-Alive, Proxy-Connection, Transfer-Encoding and Upgrade. It also requires header names to be lowercase. Most servers strip or convert these, but a header set by app code and passed straight through by a CDN or a custom proxy can still trigger the error.

Look at the raw response headers from the origin, bypassing the CDN:

curl -sv --http1.1 -o /dev/null https://origin.example.com/path 2>&1 | grep '^<'
Enter fullscreen mode Exit fullscreen mode

Any Connection: or Transfer-Encoding: header there is a candidate. So are header values containing newlines or other control characters, which sometimes sneak in when a header is built from user input or from an error message.

3. Headers that are too large

Huge cookies or many Set-Cookie lines can exceed the HTTP/2 header limits on either side. Nginx logs client sent too large header for oversized request headers; for response headers, check the CDN or load balancer logs for header-size errors.

4. A middlebox with its own HTTP/2 bugs

If you're behind a CDN or load balancer, test the origin directly and through the CDN. If only the CDN path fails, check the CDN's status page and its HTTP/2 settings; turning off HTTP/2 between the CDN and origin (not to browsers) is a reasonable temporary workaround.

A quick decision tree

  • Fails only in your browser: extension, antivirus or cache.
  • Fails everywhere, but only on big responses: disk or temp directory.
  • Fails on one specific endpoint: look at that endpoint's headers and Content-Length.
  • Fails only through the CDN: compare origin and CDN responses.
  • Fails intermittently under load: look for timeouts and resets in proxy logs.

Because the error often affects one asset or one path rather than the whole site, it's worth monitoring the specific URLs that matter (your main JavaScript bundle, your checkout API), not just the homepage. That's the kind of check upordown.online is built for.

Related reading

What caused your last ERR_HTTP2_PROTOCOL_ERROR? Has anyone else been bitten by the full-disk version?

Top comments (0)