socketio / socketio/socket.io

TRANSPORT_HANDSHAKE_ERROR

Open
#5,325 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

to triage
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The named entry point is the Engine connection_error listener; begin by tracing the transport handshake path around that event and the AWS load-balancer setup. The report provides no reproduction steps, affected-user details, files, or tests, so first establish a reproducible case; done means identifying the failing handshake condition and verifying successful connections.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, node.js, typescript
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
22/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.