question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"code":1,"message":"Session ID unknown" - 400 (Bad Request)

See original GitHub issue

I’m running a single Socket.io server ( 2.0.3 ) .

In the client side i’m trying to allow only polling mode.

io.connect(url, {
   "transports": ['polling']
})

The problem is that polling fails and throws:

"code":1,"message":"Session ID unknown" response. And the client get disconnected.

i have tried to place node-http-proxy server in front of the socket.io server. So the client connect to node-http-proxy server. This solved the problem, but i don’t understand why…

Can someone please explain why this is happening and how to fix it ???

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vtelliercommented, Jan 29, 2018

I run into this issue as well, my server is executed in docker containers behind a load balancer. I assume this happens because the request polling request do not arrive in the same container everytime.

0reactions
darrachequesnecommented, Feb 19, 2021

For future readers: please see the documentation here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js with Socket.io - Long Polling fails and throws "code":1 ...
When I click on the GET or the XMLHttpRequest I can see that the response is "code":1,"message":"Session ID unknown" , which I don't...
Read more >
How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something that is perceived...
Read more >
Troubleshooting connection issues | Socket.IO
400 Bad Request : when something went wrong. In case of an HTTP 400 response, the response payload will be one of the...
Read more >
How to connect Socket.io to App Platform - DigitalOcean
... url the page returns {“code”:1,“message”:“Session ID unknown”}. ... /questions/socket-io-call-throwing-400-bad-request-for-some-users.
Read more >
How to Scale Node.js Socket Server with Nginx and Redis
This article will explain one of the most popular ways of scaling Node.js ... The Server will return an error with a Session...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found