Skip to content

TRANSPORT_HANDSHAKE_ERROR #5325

Open
Open
@sridhard

Description

@sridhard

Describe the bug
I am using socketio with eiows and fastify
We are running socketio on AWS EC2 instance behing loadbalancer.
Few of the users(Approx 1%) are not able to connect to socketio server and getting TRANSPORT_HANDSHAKE_ERROR.

I have printed the logs like below:

    fastify.io.engine.on("connection_error", (err) => {
      console.error("Socket connection error: code: " + err.code); // the error code, for example 1
      console.error("Socket connection error: message: " + err.message); // the error message, for example "Session ID unknown"
      console.error("Socket connection error: context: " + JSON.stringify(err.context)); // some additional error context
    });

Below are the logs:

Socket connection error: code: 3
Socket connection error: message: Bad request
Socket connection error: context: {"name":"TRANSPORT_HANDSHAKE_ERROR"}

To Reproduce
I am not sure about the reproduction condition. It is happening for few users and we dont have the user details to connect to them,

Socket.IO server version: 4.8.1

Expected behavior
Socket connection should be success

Metadata

Metadata

Assignees

No one assigned

    Labels

    to triageWaiting to be triaged by a member of the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions