Understanding and Fixing “net::ERRHTTP2PROTOCOL_ERROR” in WordPress
Are you receiving an error labeled net::ERR_HTTP2_PROTOCOL_ERROR when working with your WordPress site? You’re not alone, as this can be common. It’s typically tied to network issues, specifically related to data transmission from the server to the client (your web browser). There are two main reasons why you might come across this error:
- Non-existent or limited disk space on the server running your website.
- An issue with a setting called minBytesPerSecond on servers that use Internet Information Services (IIS).
Solution 1: Free Up Disk Space on Your Server
If you’re running out of memory, files may not upload or download correctly. In this scenario you need to increase your server’s disk space. To do this, you can delete unused files and applications, or upgrade your hosting plan if your website needs more space than currently provided.
Solution 2: Adjusting the minBytesPerSecond Setting
A more technologically advanced issue revolves around the minBytesPerSecond setting. This can be found in IIS servers (system.applicationHost/webLimits). IIS uses this setting to protect against slow drip denial of service (DoS) attacks. In layman’s terms, these attacks aim to overload a server with requests, bringing a website to a halt.
The minBytesPerSecond setting determines a minimum data transfer speed. If the transfer falls below this limit, IIS cuts the connection, which can trigger the net::ERR_HTTP2_PROTOCOL_ERROR.
While this measure provides protection, it can have unintended side effects. For instance, if a visitor requests a large amount of data from your website (e.g., viewing a page with multiple large images), the server has to spread the bandwidth across all the items. If some items fall below the minBytesPerSecond threshold due their share of the bandwidth, IIS will cut the connection, causing the error.
To solve this, consider adjusting the minBytesPerSecond setting. Here’s how to do it:
- Open IIS’s Configuration Editor.
- Navigate to system.applicationHost/webLimits.
- Change minBytesPerSecond from its default setting 240 to 0.
- Save the changes.
If you’re not sure whether the minBytesPerSecond setting is causing the problem, you can confirm by using Chrome’s Network Log Export tool.
- Open your Chrome and type chrome://net-export/ into the address bar.
- Run the tool, recreate the error, and stop the tool.
- Import your log into the log viewer at https://netlog-viewer.appspot.com/#import.
- Look for an event titled HTTP2_SESSION_RECV_RST_STREAM with error code 8 (CANCEL). This shows that the server canceled a connection because it fell below the minBytesPerSecond threshold.
Changing minBytesPerSecond to 0 should stop the connections from being cut, thus resolving the net::ERR_HTTP2_PROTOCOL_ERROR. However, keep in mind that this slightly reduces protection against slow drip DoS attacks.
If you’re not using IIS but still encounter the net::ERR_HTTP2_PROTOCOL_ERROR error, your server may have a similar setting related to minimum throughput rate. Investigate and adjust as necessary.
By understanding these concepts and applying the fixes, you can prevent the net::ERR_HTTP2_PROTOCOL_ERROR from becoming a recurring bother as you fine-tune your WordPress site. Happy web designing!