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

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
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
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
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
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews