Skip to content
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

ECONNRESET error #3517

Closed
livesankp opened this issue Oct 25, 2015 · 14 comments
Closed

ECONNRESET error #3517

livesankp opened this issue Oct 25, 2015 · 14 comments
Labels
question Issues that look for answers. windows Issues and PRs related to the Windows platform.

Comments

@livesankp
Copy link

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 ?

@mscdex mscdex added the question Issues that look for answers. label Oct 25, 2015
@Fishrock123 Fishrock123 added the windows Issues and PRs related to the Windows platform. label Oct 26, 2015
@Fishrock123
Copy link
Contributor

@livesankp you said you were using the serialport module on node v4? Did you npm rebuild successfully?

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?

@MylesBorins
Copy link
Contributor

@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?

@livesankp
Copy link
Author

@Fishrock123 npm rebuild is successful.

@livesankp
Copy link
Author

@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.

@thorn0
Copy link

thorn0 commented Oct 30, 2015

It might be the same issue as #3595. As for uncaughtException, you could've misspelled the name of this event.

@livesankp
Copy link
Author

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 : 1

I 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.

@livesankp
Copy link
Author

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.

@thorn0
Copy link

thorn0 commented Oct 30, 2015

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 call process.exit when this exception happens. It's safe to ignore it, but I'm not sure what's the best way to distinguish it from other uncaught ECONNRESET exceptions.

@livesankp
Copy link
Author

@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 ?

@thorn0
Copy link

thorn0 commented Oct 31, 2015

Just handling uncaughtException works fine for me. I didn't change jsdom's config for it to work.

@livesankp
Copy link
Author

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');

@livesankp
Copy link
Author

@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.

@thorn0
Copy link

thorn0 commented Nov 2, 2015

Just try disabling keep-alive:

document = jsdom('na', { agentOptions: { keepAlive: false }})

It should help if it's really the same issue as #3595.

@jasnell
Copy link
Member

jasnell commented Mar 22, 2016

Closing as it does not appear to be an actionable issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

6 participants