Meteor randomly crashes at events.js with Error read ECONNRESET

My Meteor app sometimes crashes with the following console messages:

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:907:11)
    at TLSWrap.onread (net.js:558:26)

Has anyone seen this before or know how to fix?

I am running the Meteor app behind an Nginx reverse proxy.

1 Like

Anybody??

I seems to happen fairly often. I cannot tell if itā€™s a NodeJS problem or a Meteor problem, and hoping to find some tips to help me start troubleshooting the problem.

Where your app is hosted? If it is VPS, most often server doesnā€™t have virtual memory enabled by default, and if physical memory usage is 100% strange things can happen.

Thanks for the reply. Hosted on my own dedicated Linux/CentOS machine with 16GB RAM. At this time, 10GB of RAM is free.

I just changed my meteor to run with --verbose, to hopefully see more output when the crash occurs next. Anyone have any other ideas how to improve the output of a crash, so I can further pinpoint the cause of the problem being a node npm module or Meteor itself?

I am still getting the crash. Happens at random times- sometimes not for a day, sometimes 2-3 times an hour. Because itā€™s inconsistent, I suspect itā€™s some kind of timeout from the server connecting to an Internet resource, or something related to a particular client-to-server communication.

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:907:11)
    at TLSWrap.onread (net.js:558:26)
=> Exited with code: 1

The --verbose does not produce any additional output with the error, so that is no help. Anyone have any ideas how to identify the cause of a Meteor crash like this?

My meteor version is meteor@1.6.1 on Linux/CentOS with 16GB RAM.

same error on my side, but couldnā€™t get more infos from the logs.

Having a similar issue on Galaxy. We did not get any for days, then 2 in one day, now 4 times this morning alone!

Was your error the same as mine?

Googling ECONNRESET points to articles referring to some kind of connection error.

Googling ā€œevents.jsā€ shows itā€™s related to the network listener. I am guessing thereā€™s a bug with the network listener. OR, some Meteor internal task, like version checker, that hits a network error and crashes everything. Those are my guesses. Without any further debugging/tracing, and since the problem happens so randomly, I have no idea what the problem could be.

2017-04-27 09:37:17-07:00events.js:72
2017-04-27 09:37:17-07:00 throw er; // Unhandled ā€˜errorā€™ event
2017-04-27 09:37:17-07:00 ^
2017-04-27 09:37:17-07:00Error: read ECONNRESET
2017-04-27 09:37:17-07:00 at errnoException (net.js:905:11)
2017-04-27 09:37:17-07:00 at TCP.onread (net.js:559:19)

I am using Meteor 1.3.2.2 (newer versions have/had bugs with viewmodel so we have held off on them).

Yeah it is very frustrating, no way to find the issue or debug it. If it is not happening at all for days, then many times in one day, that suggests thereā€™s something affecting it inside the application. But not sure how to find out whatā€¦

Galaxy support suggested that I use the NPM package ā€˜longjohnā€™ā€¦

It seems longjohn is not compatible with Meteor. If I add the NPM package, and ā€˜requireā€™ it in any file, the server hangs on startupā€¦

SO I am out of luck until finding some sort of solutionā€¦

Yeah this is super annoying

I updated node to version 7.10.0, and npm to version 5.0.3. It worked for me.

@Spyridon
@jamgold

Has anyone managed to find the cause of this issue?

I suspect it is either the Email package, or an NPM activedirectory package Iā€™m using to authenticate on a windows network.

I am running a relatively old version of Meteor (1.4.4) - does this error go away with an updated version of Meteor?

I am on 1.5.1 now and havenā€™t seen this problem anymore.

Thanks jamgold, will test that migration to 1.5.1

I am using Meteor 1.5.1, node is 8.4.0 and npm is 5.3.0. The issue is still there. I am using a proxy and the application is running in a VM.

I am using Meteor 1.5.2.2 and getting this issue when I try to create a project or pretty much do anything.

Npm is at version 5.3.0 and node at 8.6.0

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at exports._errnoException (util.js:907:11)
    at WriteWrap.afterWrite (net.js:790:14)