Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why did I have to disable HTTP/2 in AWS Application Load Balancer to prevent ERR_SPDY_PROTOCOL_ERROR?

When I deployed my web application to an AWS environment with an Application Load Balancer (ALB), some of my web service endpoints would not return any data and my Chrome browser would report this error for some http calls: ERR_SPDY_PROTOCOL_ERROR

Upon finding this recommendation, I disabled HTTP/2 support in my ALB configuration and everything works now.

Why did I have to disable HTTP/2 in my ALB? What is the root issue here? Do I need to change something in my web service code so that I can use HTTP/2?

UPDATE

Here are the response headers:

HTTP/1.1 200
Date: Wed, 09 Jan 2019 21:39:13 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Locations Reached: Data to populate locations reached map

As suggested by one of the answers below, the culprit is probably the fact that one of my headers (Locations Reached) has a space in the name, which is invalid/malformed. I'll make sure that space gets replaced by a dash.

like image 262
CFL_Jeff Avatar asked Oct 15 '25 03:10

CFL_Jeff


1 Answers

Usually means you have an invalid HTTP/2 header. HTTP/2 is more strict than HTTP/1.1 in this regard.

So HTTP header names with colons, spaces, new lines (e.g. opening quotes but forgetting to close the quotes in your config) and the like in the name are invalid (these can exist in the header values but not in the names).

See here for details on how to debug: https://www.michalspacek.com/chrome-err_spdy_protocol_error-and-an-invalid-http-header.

Add your HTTP/1.1 response headers to your question and might be able to point you in the right direction.

like image 197
Barry Pollard Avatar answered Oct 18 '25 03:10

Barry Pollard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!