Open moxpatwa opened 1 year ago
@stouset Any update on above issue
@dshaw and @darrachequesne any update on above issue.
Hi! HTTP 400 status usually means sticky sessions are not enabled properly, could you please check?
Thanks @darrachequesne .. i will try enable sticky session and let you if i still facing same issue or not.
@darrachequesne I am using node.js for service and react for frontend.. to enable sticky connection can you suggenst me best approach as our nodejs service are contains some rest endpoints ,schedules some job, socketio events. To enable sticky i have made below change in server file
and client side code is below:
After making these change still getting session is unknown error. let me guide on this.
For those who are having trouble with sticky session polling on a Kubernetes server. Below is an example of annotations declaration in ingress.yaml to enable the sticky session.
Status: 400 Error: {"code":1,"message":"Session ID unknown"}
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "route"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
@fillipearaujo Thank for reply but we are creating docker image of nodejs service and deploy and run via aws ec2 instance docker container.
@darrachequesne Any update on issue because it is impact our RTD app. Really appreciate your help on this
@darrachequesne Any update on above issue?
@moxpatwa sticky sessions are needed in case you have multiple Socket.IO server (for example when running with pm2). Is that your case?
See also: https://socket.io/docs/v4/troubleshooting-connection-issues/
@darrachequesne No we dont multiple Socket.io server.
I see you set pingTimeout
to 6000
(6 seconds), which might be a bit low on mobile networks. If the client does not respond to the health check in the given delay, then the connection will be closed. Any reason for not using the default value?
Reference: https://socket.io/docs/v4/server-options/#pingtimeout
@darrachequesne Actually i have update code with below
But still facing Session ID unknown error
I'm out of ideas then... "Session ID unknown" means the session ID is not recognized by the server, which is usually caused by:
Do you get a "disconnect" event?
socket.on("disconnect", (reason, details) => {
// the reason of the disconnection, for example "transport error"
console.log(reason);
// the low-level reason of the disconnection, for example "xhr post error"
console.log(details.message);
// some additional description, for example the status code of the HTTP response
console.log(details.description);
// some additional context, for example the XMLHttpRequest object
console.log(details.context);
});
Reference: https://socket.io/docs/v4/troubleshooting-connection-issues/#problem-the-socket-gets-disconnected
I also get this error when using multiple containers in ECS
Hello,
I am getting HTTP Error 400 around.
I am using socket-io 4.7.2 and socket-io-client 4.7.2 and I am using react for front end this is my client side settings
in server side using node is which setting describe below:
Can you suggest me solutions for that?
Originally posted by @moxpatwa in https://github.com/socketio/socket.io-client/issues/1474#issuecomment-1828424530