How to debug a long error stack?

I would start from top to bottom as this is a stack trace - look at what the exact error is and then check what data is being passing to library calls.

Error at this line (most likely as I don’t know your library versions) - matches your stack trace:

It has something to do with Payload length or indirectly Payload itself?

Little more context about the app would help - is this phoenix app or elixir app with cowboy web sockets ? What versions of libraries you are using?