Skip to content

ECONNRESET error #3517

Description

@livesankp

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 ?

Activity

  1. added
    questionIssues asking questions about Node.js.
    on Oct 25, 2015
  2. added
    windowsIssues and PRs related to the Windows platform.
    on Oct 26, 2015
  3. Fishrock123 commented on Oct 26, 2015

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

  4. MylesBorins commented on Oct 26, 2015

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

  5. livesankp commented on Oct 26, 2015

    @livesankp
    Author

    @Fishrock123 npm rebuild is successful.

  6. livesankp commented on Oct 26, 2015

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

  7. thorn0 commented on Oct 30, 2015

    @thorn0

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

  8. livesankp commented on Oct 30, 2015

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

  9. livesankp commented on Oct 30, 2015

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

  10. thorn0 commented on Oct 30, 2015

    @thorn0

    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.

  11. livesankp commented on Oct 31, 2015

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

  12. thorn0 commented on Oct 31, 2015

    @thorn0

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

  13. livesankp commented on Oct 31, 2015

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

  14. livesankp commented on Nov 2, 2015

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

  15. thorn0 commented on Nov 2, 2015

    @thorn0

    Just try disabling keep-alive:

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

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

  16. jasnell commented on Mar 22, 2016

    @jasnell
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues asking questions about Node.js.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions