mtrudel/bandit

Request line read errors

Closed this issue · 2 comments

We switched from cowboy to bandit and everything seems to be working flawlessly, apart from some errors that have started popping up at runtime:

** (ErlangError) Erlang error: "request line read error: \"Zt8HIXXpbKlriXl5Qkl1x\\\",\\n\""

It looks something is sending malformed requests to our public endpoints, which is totally fine, but somehow these malformed requests then cause a runtime exception which in turn triggers our monitoring system. Wouldn't be better to just log an error in these cases?

thanks!

This is 'by design'; Thousand Island (and by extension Bandit) explicitly log loudly on all abnormal conditions, even they are 'normal' abnormal conditions. This has revealed a number of upstream bugs to date that were being silently discarded by Cowboy. I feel very strongly that this should continue to be the default behaviour of this stack. That having been said, I recognize that some folks are going to want the classic 'silent' behaviour of Cowboy, for any number of valid reasons. I've pushed up PR to Thousand Island to provide a setting that should help in your case:

mtrudel/thousand_island#92

Once that gets reviewed (feel free to chime in!) and merged, I'll cut a new Thousand Island release and you can opt into this behaviour by adding a config like thousand_island_config: [silent_terminate_on_error: true] to your bandit config.

Thousand Island 1.1.0 just released with support for the above flag; updating your dependency and adding the new config point as described above should fix your problem!

Thanks for the issue!