Repository navigation
ECONNRESET error #3517
Description
Activity
- addedquestionIssues asking questions about Node.js.Issues asking questions about Node.js.
on Oct 25, 2015 - addedwindowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
on Oct 26, 2015 @livesankp you said you were using the serialport module on node v4? Did you
npm rebuildsuccessfully?It's a possibility this is the result of a subtle change somewhere, could you perhaps try looking though https://github.com/nodejs/node/wiki/API-changes-between-v0.10-and-v4 for anything suspect?
@livesankp can you tell me more about signalr? How are you receiving the data on the server? Are you able to make a minimal example of an application that displays this problem?
@Fishrock123 npm rebuild is successful.
@thealphanerd I am using signalr from here http://www.asp.net/signalr
Loading required signalr.js file using require and also loading jQuery, jsdom as a dependancy.
my http calls are fine using jQuery ajax. i am able to receive events in signalr long polling and able to read/write to serialport too. but suddenly program is getting stop. I have tried uncaughexception catch but nothing is being catch.It might be the same issue as #3595. As for
uncaughtException, you could've misspelled the name of this event.I have this as a handler.
process.on('uncaughtException', function(error) {
console.error((new Date).toUTCString() + ' uncaughtException:', error.message)
console.error(error.stack);
process.exit(1)
})Error is
Fri, 30 Oct 2015 19:25:07 GMT uncaughtException: read ECONNRESET
Error: read ECONNRESET
at exports._errnoException (util.js:849:11)
at TCP.onread (net.js:544:26)
exited : 1I thought it would be due to signalr so i commented its initialization but still able to reproduce this.
I am sure it is due to serialport now.
Taking my words back for serialport. I re run the program again with commented all code related to jquery ajax service call and signalr and program is not crashing. so looks like it has some issue with continuous long polling connection probably which signalr uses or initial calls done by jquery.
It's not related directly to long polling. It's caused by any HTTP requests issued by jsdom, whose default settings for HTTP are
{ keepAlive: true, keepAliveMsecs: 115000 }. So it's #3595. For now, just don't callprocess.exitwhen this exception happens. It's safe to ignore it, but I'm not sure what's the best way to distinguish it from other uncaughtECONNRESETexceptions.@thorn0 even i am not using process.exit it is terminating the process. Do you know why ? If you know jsdom is the problem can you share jsdom initialization code with me ?
Just handling
uncaughtExceptionworks fine for me. I didn't change jsdom's config for it to work.I had handled too and i commented process.exit line but still it happens. If you don't mind can you show me your jsdom initialization.
This is how i am doing.
//jsdom dependancy of jQuery
var jsdom = require('jsdom').jsdom, document = jsdom('na');
global.window = document.defaultView;//jQuery
var $ = require('jquery');
$.support.cors = true;
window.jQuery = $;//SignalR added externally, Configuration, Common functions, Constant
var signalr = require('./util/jquery.signalR-2.2.0.js');@thorn0 so i run two tests. One for Serialport and One for signalr with jsdom and jquery. When i ran both separately no one failed. But the moment i combined both in same process it stopped. So really confused now why both are not working together.
Just try disabling keep-alive:
document = jsdom('na', { agentOptions: { keepAlive: false }})It should help if it's really the same issue as #3595.
Closing as it does not appear to be an actionable issue.
Hello,
I have upgraded Nodejs from v0.12 to 4.1.2/4.2.1. I have tried both of this latest version.
I am using signalr.js file for connection to server. Running node.js program on windows which is communicating to serialport using serialport module after getting data over signalr. Everything works but after few message exchange betn client and server using signalr, client program stops and not receiving any messages and i am seeing ECONNRESET error.
Everything was working but after upgrade this broke. Trying to figure out this from past couple of days but stil no luck. Is there anything new i have to configure in my node program related to signalr. Is the signalr long polling connection aborting ?