User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
I m running an Express js application with socket.io for a chat webapp and I get the following error randomly around 5 times during 24h. The node process is wrapped in forever and it restarts itself immediately.
Problem is that restarting express kicks my users out of their rooms and nobody wants that.
The web server is proxied by HAProxy. There are no socket stability issues, just using websockets and flashsockets transports. I cannot reproduce this on https://forum.tuteehub.com/tag/purpose">purpose.
This is the error with node v0.10.11:
events.js:72throw er;// Unhandled 'error' event^Error: read ECONNRESET //alternatively it s a 'write'
at errnoException (net.js:900:11)
at TCP.onread (net.js:555:19)
error:Forever detected https://forum.tuteehub.com/tag/script">script exited with code:8
error:Forever restarting https://forum.tuteehub.com/tag/script">script for2 time
EDIT (2013-07-22)
Added both socket.io client error handler and the uncaught https://forum.tuteehub.com/tag/exception">exception handler. Seems that this one catches the error:
process.on('uncaughtException',function(err){
console.error(err.stack);
console.log("Node NOT Exiting...");});
So I suspect it's not a socket.io issue but an http request to another server that I do or a mysql/redis connection. Problem is that the error stack doesn't help me identify my code issue. Here is the log output:
Error: read ECONNRESET
at errnoException (net.js:900:11)
at TCP.onread (net.js:555:19)
How do I know what causes this? How do I get more out of the error?
Ok, not very verbose but here s the stacktrace with "longjohn":
You might have guessed it already: it's a connection error.
"ECONNRESET" means the other side of the TCP conversation abruptly closed its end of the connection. This is most probably due to one or more application protocol errors. You could look at the API server logs to see if it complains about something.
But since you are also looking for a way to check the error and potentially debug the problem, you should take a look at "How to debug a socket hang up error in NodeJS?" which was posted at stackoverflow in relation to an alike question.
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that
you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice
sessions to improve your knowledge and scores.
manpreet
Best Answer
3 years ago
I m running an Express js application with socket.io for a chat webapp and I get the following error randomly around 5 times during 24h. The node process is wrapped in forever and it restarts itself immediately.
Problem is that restarting express kicks my users out of their rooms and nobody wants that.
The web server is proxied by HAProxy. There are no socket stability issues, just using websockets and flashsockets transports. I cannot reproduce this on https://forum.tuteehub.com/tag/purpose">purpose.
This is the error with node v0.10.11:
EDIT (2013-07-22)
Added both socket.io client error handler and the uncaught https://forum.tuteehub.com/tag/exception">exception handler. Seems that this one catches the error:
So I suspect it's not a socket.io issue but an http request to another server that I do or a mysql/redis connection. Problem is that the error stack doesn't help me identify my code issue. Here is the log output:
How do I know what causes this? How do I get more out of the error?
Ok, not very verbose but here s the stacktrace with "longjohn":