scottmessinger

scottmessinger

Hi! After upgrading to Phoenix 1.7 (and cowboy 2.9 to 2.10), we’re seeing a bunch of odd errors from Cowboy. We haven’t noticed any user facing errors, so I’m quite confused.

The stated error is:

Ranch listener AppWeb.Endpoint.HTTP had connection process started with
:cowboy_clear:start_link/4 at #PID<0.8556.164> exit with reason:
{:function_clause, [{:cowboy_http, :commands, ....

But that doesn’t appear very helpful. Any ideas what’s going on? Has anyone else seen this?

Here's the full error:
Ranch listener AppWeb.Endpoint.HTTP had connection process started with
:cowboy_clear:start_link/4 at #PID<0.8556.164> exit with reason:
{:function_clause, [{:cowboy_http, :commands, [{:state, #PID<0.5243.0>,
AppWeb.Endpoint.HTTP, #Port<0.552217>, :ranch_tcp, :undefined, %{compress:
true, env: %{dispatch: [{:_, [], [{:_, [], Plug.Cowboy.Handler,
{AppWeb.Endpoint, []}}]}]}, idle_timeout: 70000, max_header_value_length:
50000, max_keepalive: 5000000, stream_handlers: [:cowboy_compress_h,
:cowboy_telemetry_h, :cowboy_stream_h]}, "", %{}, {{10, 0, 1, 207}, 10480},
{{<snip>, 17, 0, 3}, 4000}, :undefined,
#Reference<0.1990757299.4122214401.120008>, true, 13, {:ps_request_line, 0},
65535, 12, :done, 5000000, [{:stream, 12, {:cowboy_compress_h, {:state,
{:cowboy_telemetry_h, {:state, {:cowboy_stream_h, {:state, :undefined,
AppWeb.Endpoint.HTTP, #PID<0.3209.164>, :undefined, :undefined, :undefined,
:undefined, ...}}, #Function<0.39451584/1 in
:cowboy_telemetry_h.metrics_callback>, :undefined, %{body_length: 0, cert:
:undefined, has_body: false, headers: %{"accept" => "*/*", "accept-encoding"
=> "gzip, deflate, br, zstd", "accept-language" => "en-US,en;q=0.9", ...},
host: "www.commoncurriculum.com", method: "GET", path:
"<snip>",
...}, "200 OK", %{"Connection" => "keep-alive",
"access-control-allow-credentials" => "true", "access-control-allow-origin" =>
"*", "access-control-expose-headers" => "", "cache-control" => "max-age=0,
private, must-revalidate", ...}, AppWeb.Endpoint.HTTP, -576097733072733623,
:undefined, :undefined, :undefined, ...}}, 300, :gzip, :undefined, :sync}},
"GET", :"HTTP/1.1", :undefined, :undefined, 0, []}], [{:child,
#PID<0.3209.164>, 12, 5000, :undefined}]}, 12, [{:response, "200 OK",
%{"Connection" => "keep-alive", "access-control-allow-credentials" => "true",
"access-control-allow-origin" => "*", "access-control-expose-headers" => "",
"cache-control" => "max-age=0, private, must-revalidate", "content-encoding"
=> "gzip", "content-length" => "1379", "content-type" => "application/json;
charset=utf-8", "date" => "Tue, 27 Feb 2024 06:21:44 GMT", "server" =>
"Cowboy", "vary" => "accept-encoding", "x-request-id" =>
"<snip>"}, [[<<31, 139, 8, 0, 0, 0, 0, 0, 0, 3>>], <<237, 152,
109, 111, 163, 70, 16, 199, 191, 74, 197, 219, 218, 167, 93, 88, 48, 248, 93,
122, 74, 37, 75, 105, 175, 106, 210, 158, 170, 83, 84, 237, 195, 16,
...>>]}]], [file: ~c"/app/deps/cowboy/src/cowboy_http.erl", line: 957]},
{:cowboy_http, :loop, 1, [file: ~c"/app/deps/cowboy/src/cowboy_http.erl",
line: 257]}, {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line:
240]}]}

Showing Posts 1 to 3

al2o3cr

al2o3cr

The error is complaining that no head of :cowboy_http.commands matches the input:

  • a state record with out_state set to :done
  • a stream ID of 12
  • a list of commands:
    [
      {:response, "200 OK", %{"Connection" => "keep-alive", ...}, <<...>>}
    ]
    

This appears to be caused by a late response from the handler - the head that handles response commands matches on out_state being :wait, so it doesn’t match:

scottmessinger

scottmessinger OP

Thank you @al2o3cr ! That’s very insightful. Any idea what could be causing this? Is it related t Phoenix or something we might be doing in our app?

scottmessinger

scottmessinger OP

Just wanted to followup and say my problem is I was calling render two times in the controller (result of a bad merge):

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

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
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews