coder/websocket

failed to get reader: failed to read frame header: EOF

Opened this issue · 1 comments

What does this error mean?

You can read the context log of this issue at switchupcb/disgo#81.

Here is the code involved.

{"level":"info","time":"2025-02-25T11:15:50.047882793Z","session":"19a66158dd23faa53df0a0cce17ea441","client":"948649712649662524","message":"received signal: <-s.Context.Done with state \"connected\""}

This log is output at https://github.com/switchupcb/disgo/blob/v10/wrapper/session_routine_manager.go#L114

{"level":"info","time":"2025-02-25T11:15:50.064255893Z","session":"19a66158dd23faa53df0a0cce17ea441","client":"948649712649662524","error":"listen: failed to get reader: failed to read frame header: EOF","message":"<-s.Context.Done manager wait error result"}

This log is output at unimplemented in public which contains LogSession(Logger.Info(), s.ID).Str(LogCtxClient, bot.ApplicationID).Err(err).Msgf("<-s.Context.Done manager wait error result")

It means the connection is closed, by the other end or by a third party.

I got the same error today. In my case, nginx closed the connection after a timeout. My workaround for now is to set a longer timeout for nginx, but a proper fix is to use ping/pong messages to keep the connection alive. I come here to look for information about this.