-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unexplained disconnect 'transport end' after upgrading #777
Comments
0.9.1 could have introduced a bug with heartbeats triggering premature disconnects. |
Ditto. Seeing repeated disconnects/reconnects in Chrome & FF on Mac, client & server on same machine. |
Having the same issue...I also noticed that immediately after the socket disconnected a new socket was instantiated. Workaround for me was manually setting the close timeout: io.configure( function() {
io.set('close timeout', 60*60*24); // 24h time out
}); |
I was having this problem too. Thanks steffenwt for the workaround. |
Yep, I have this error too. I started learning socket.io a few days ago and I first thought I was doing something wrong. |
Downgrading to 0.9.0 works. Not sure if relevant, but the socket gets closed on every other heartbeat. So it goes like this
Log here:
|
I has the problem too. I use 0.91-1 . I try it ,but has this problem. io.configure( function() { |
same problem here |
Did you downgrade to 0.9.0 ? I now marked it as latest on NPM |
same issue here for 0.9.1-1, juste downgraded to 0.9.0, and the problem is gone. |
as a workaround you can send some keep-alives from client, for say 20 secs and immediately answer those from server: client: setInterval(function() { socket.emit("keep-alive", null) },20*1000); |
FWIW: If you are serving the client from a different server, and your client code is not downgraded to 0.9.0 then you'll still see the problem. I downgraded 'socket.io' to 0.9.0 and I still saw the problem. Then I downgraded socket.io-client to 0.9.0 and I don't get the disconnect. Also, the transports I've tried that fail are web sockets and xhr-polling. |
This issue should get closed, right? |
I have the same problem. But I noticed that it is because I have haproxy. My problem is here:
Right in the line "timeout client 1000" (I changed it to 1 second to see if it was the problem, and it was...). So now I'm searching if there is a way to change it only for the websocket backends. I hope this help someone 👍 |
FYI, I'm still seeing this issue, too, with xhr-polling and 0.9.14. There's a forced disconnect every 25 seconds. Log is identical to above. |
I can also verify that this is happening with 0.9.14 server and 0.9 client. Although it doesn't disconnect every 25 seconds, it does disconnect intermittently. I traced it to a call stream.emit('end'); in node.js' _stream_readable.js. I think it is a result of reading EOF in the buffer. |
@citosid why would haproxy client timeout cause this? |
Happening with 0.9.16. Same thing as for BoarK |
Is socket.io support dead? |
@joefaron There has to be support before it can die. So no, Socket.IO support isn't dead, it just never existed. |
Same issue here with Socket.io 0.9.16 - Seeing connections drop every ~25 seconds and logs showing "discarding transport" at the same time. |
Downgrading to 0.8.6 fixed basically everything for me.. and i'm using On Sun, Jan 26, 2014 at 10:16 AM, Aran Reeks notifications@github.comwrote:
|
Hi @joefaron, cheers for your help. I've been playing about a little with the different config options this evening and will look further into it tomorrow but I can confirm the issue is with the heartbeat checks failing. These checks are in place to ensure connections to a user are still required and they haven't left without sending a disconnect for any reason. I've been able to replicate this bug in both Firefox & the current stable build of Chrome (32.0.1700.76 m). Initially I attempted to completely disable heartbeats as for our application they weren't really going to be required, this can be done as follows (according to the current docs although when I tried this it seemed to remove all the transport methods and ended up constantly crashing and restarting). As this failed, my next attempt was to increase the timeout between heartbeat requests which can be done using the following within your app.js: This worked a treat for our application as we don't care about client disconnects, this may not be a viable option in your environment though. For anyone else with this issue in case it helps, my environment is as follows: |
I think this is a really urgent / critical issue. Why hasn't it been resolved yet? Two years have passed since the start of this issue thread. I'm also experiencing this issue:
|
d-oliveros: I highly suggest downgrading to 0.8.6. I haven't had this On Sat, Feb 15, 2014 at 8:55 PM, d-oliveros notifications@github.comwrote:
|
Please try the new |
I didn't. |
@rauchg, I am banging my head to the wall with this issue it won't let me complete an upgrade.. and refactor my code with new socket.io... using https and Nginx proxing socket.io.. Is anyone else having the same issues or is just me? |
I think I might be as well.. very difficult to pinpoint my case though. I'm using sails.js with socket.io. ubuntu 14.04 My client is a mix of socket.io-client and sails.io.js:
So the initial connection lasts forever...but then after an .emit() or .broadcast() to this client, the server dumps the client after ~25 seconds to 1min AND..the client doesn't get notified of the disconnect. It thinks it's still connected. Very frustrating. |
I'm having a similar issue, but only if I use a secure socket (wss instead of ws). With ws everything works fine but with wss the connection gets dropped sporadically at random times (~15 minutes). No firewalls, no proxies. |
Thank you @andrin-n-dream I think mine is related to SSL as well. I have a windows machine as the client and my ubuntu vm (same machine) as the server. Bridged network adapter. Never have had any issues with the general network connection. Happens on SSL regardless whether I use nginx SSL or sails.js SSL termination. |
NAVER - http://www.naver.com/oniono@naver.com 님께 보내신 메일 <Re: [socket.io] unexplained disconnect 'transport end' after upgrading (#777)> 이 다음과 같은 이유로 전송 실패했습니다. 받는 사람이 회원님의 메일을 수신차단 하였습니다. |
I debugged forever and could not find another solution for SSL but to reconnect manually. Would be great if engine.io would do this for me and retry when the transport is closed. |
is there a solution for this? i am having the exact same issue. after a few seconds, i get a heartbeat timeout in the debug log from server but the client still thinks it's connected. |
Well due to other pressing issues I have upgraded my env and this is now on the backburner. Would be nice to see if node 6.5.0 makes any difference. Sails.js has updated some packages and changed its use of these low-level functions... I just don't have time to dive into this again right now as I'm migrating a massive amount of legacy C++. Maybe later this year or January. |
this is still happening on 2.0.3 ... without a workaround, socket.io is basically unusable because 25% of your clients are going to have this problem. |
@Aaron1011 Is this meant to be server-side or client code? If its server side, does anything need to be changed on the client end? |
Tried: |
Could not downgrade to 0.8.6 because it indeed up being a massive rabbit hole. All the syntax has changed and since there is no documentation i could find on 0.8.6, it's a lost cause. I really don't feel like rewriting my app to downgrade to an ancient version on the hope that it might fix this issue. Does anyone have any ideas/fixes for v2.03? Things I've tried:
I'm positive it's not a coding error but is PC-specific as it happens on some and not on others. It might have something to do with the network adaptar. |
@forgeableSun you should write ur app based on Primus, I refactored my app with primus and currently using socketJs with it.. Support some other project no need to change code in other to use any other real time project.. Regards. |
@utan I'd love to try it. but how exactly do i switch from socket.io with one line of code? There doesn't seem to be any examples on switching from other frameworks. |
npm install browserchannel --save var primus = new Primus(server, { transformer: 'browserchannel' }); https://github.com/primus/primus/blob/master/README.md#supported-real-time-frameworks Hope helps. |
what does browser channel have to do with socket.io? |
That's just an example how to switch to a different framework.. As you asked for an example.. |
okay, but socket.io is not even listed as one of the supported realtime frameworks. it's never just 1 line of code to switch APIs, I don't see how the docs can advertise that without giving any examples. |
Listen, socket.io is buggy after >= 1 it has weird disconnects, me suggesting to use primus is so u can switch to a different framework.. That's why I gave u an example, of course u will need to refactor code to use primus then after u are gonna be free to try different frameworks to see which one is best for u or if one breaks then u use a different one.. Regards |
@utan I see, I was thinking it was a transformer for switching from 1 framework to another with the entire app written in that framework (like an adapter). But really, it's a transformer for seamlessly switching to frameworks with the entire app written in primus. |
Indeed, u went up my head.. i am not as proficient to know the difference, thought we were talking about same thing.. Regards. |
My server logs: |
Switched to ws (https://github.com/websockets/ws) which involved massive rewrites, but i now use the native websocket browser object on the client side and everything works perfectly. I no longer have the problem. So long socket.io! |
I was getting random disconnects after 10 to 30 minutes. I recalled that my hosting service runs NodeJS with Passenger on an Apache shared server. I don't really understand it but basically there are meant to be issues with websockets in this kind of integration. I am testing with setting transports: ['polling'] only, while on the localhost I an run with transports: ['websockets', 'polling'] without errors and dropouts. So far so good after 30min... |
Closed due to inactivity, please reopen if needed. |
Well, I am seeing seeing the issue in 2021 when connecting from a 2.* client to a 3+ server. Quite annoying. |
@namxam did you enable the compatibity mode? Reference: |
After adding a dependency to my package.json today I removed my node_modules and ran npm_install. I didn't specify any version number for socket.io so I guess it picked up the latest.
After I did that I noticed that within ? a minute or so of starting up my application, my socket would be disconnected and I see a 'transport end' info message in the node.js console output. I having socket.io set for websockets only. I am on Chrome 13 on Linux.
I went into package.json and set it at 0.8.7, ran npm install again, and now I am not seeing disconnects anymore.
Hopefully I wasn't just confused about something. I did go back and repeat the steps and had the same result. Sorry I don't have more specific information.
The text was updated successfully, but these errors were encountered: