Start from the top - this is the root cause of the error - :erlang.iolist_size/1 is raising :badarg. The most common cause of this is passing something in that’s not the right shape.
The next two frames for :cow_ws.payload_length and :cow_ws.frame aren’t particularly interesting.
The frame for :cow_ws.websocket_send gives us another piece of information: we’re trying to send whatever the badly-shaped data is down a websocket
But the really important one is the frame after that: :cow_ws.handler_call. This is the “brains” of the websocket handler:
This is why the stack doesn’t have any application code in it - the application code is called in the first part of handler_call, and then the result of that is what’s being handled when the crash happens.
Check your code that’s sending data via websockets; has a stray {:ok, "data that should be sent"} snuck in someplace where you’re expecting just "data that should be sent"?






















