sribe

sribe

This is maybe a Cowboy question, not sure if there’s a way forward in Elixir/Phoenix without diving into Erlang/Cowboy, but I’d sure like to know if there is. In a Phoenix app, the logs are just about useless because they are filled with a constant stream of the error below. Is there a config I can change to log a bit more info about these requests, so I can find the source and shut it down or block it?

10:34:23.488 [error] Cowboy returned 400 because it was unable to parse the request headers.

This may happen because there are no headers, or there are too many headers
or the header name or value are too large (such as a large cookie).

You can customize those values when configuring your http/https
server. The configuration option and default values are shown below:

protocol_options: [
  max_header_name_length: 64,
  max_header_value_length: 4096,
  max_headers: 100,
  max_request_line_length: 8096
]

Showing Posts 1 to 4

realcorvus

realcorvus

Another user on here was able to attach a telemetry handler, How to log malformed requests which cause cowboy to terminate request? - #2 by heathen

What environment is your app hosted in?

al2o3cr

al2o3cr

One way I’ve seen an error like this happen is if you put a large struct into the Phoenix session - the cookie can puff up bigger than 4KB and break things. For instance, a whole SAML response…

sribe

sribe OP

Thanks! (It’s hosted on bare metal Linux server to which I have root access.)

sribe

sribe OP

Ah, good to know. But I put like 2 UUIDs and a timestamp in the cookie, so that’s not the case here. The requests are extremely regular and 24/7, so I’m pretty sure it’s an external probe.

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews