Haproxy swallowing 500 errors

When I send a request to the backend server I get a 500 error. If I send the same request to the frontend it returns with a 502. I read another thread that said it was a retry error. I set the following settings explicitly in the config and it did not fix it.
retries 0
retry-on none
option redispatch 0

I did find this error from the admin socket:
[25/Jan/2022:09:49:28.095] backend dialog.aa1.proquest.com_green (#10): invalid response
frontend brokenfrontend (#8), server server201 (#1), event #0, src 123.234.123.234:36221
buffer starts at 0 (including 0 out), 1055 free,
len 15329, wraps at 16336, error at position 15323
H1 connection flags 0x00000000, H1 stream flags 0x00004044
H1 msg state MSG_CHUNK_SIZE(26), H1 msg flags 0x00001736
H1 chunk len 0 bytes, H1 body len 0 bytes :

00000 HTTP/1.1 500 500\r\n
00018 Date: Tue, 25 Jan 2022 14:49:27 GMT\r\n
00055 Server: Apache/2.4.33 (Unix) OpenSSL/1.0.2k-fips\r\n
00105 Set-Cookie: JSESSIONID=672A258FAAE1E17A6625F8499C7A3B6A-nm4.nt1; Path=
00175+ /professional; Secure; HttpOnly\r\n
— snip —
15235 Content-Type: text/html;charset=UTF-8\r\n
15274 Connection: close\r\n
15293 Transfer-Encoding: chunked\r\n
15321 \r\n
15323 7ff0\r\n

You have a extremely large amount of HTTP headers in this response, you are at 15k, so you likely hit the limit:

http://cbonte.github.io/haproxy-dconv/2.4/configuration.html#3.2-tune.bufsize

If an HTTP request is larger than (tune.bufsize - tune.maxrewrite), HAProxy will
return HTTP 400 (Bad Request) error. Similarly if an HTTP response is larger
than this size, HAProxy will return HTTP 502 (Bad Gateway).

Bump tune.bufsize or reduce the HTTP headers in the response.

quick test after upping tune.bufsize to 128000 worked, thanks!

1 Like