Meteor randomly crashes at events.js with Error read ECONNRESET


#1

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.


(Segmentation fault: 11) Meteor crashing during development
#2

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.


#3

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.


#4

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


#5

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?


#6

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.


#7

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


#8

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


#9

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.


#10

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


#11

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…


#12

Yeah this is super annoying


#13

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


#14

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


#15

I am on 1.5.1 now and haven’t seen this problem anymore.


#16

Thanks jamgold, will test that migration to 1.5.1


#17

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.


#18

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)

#19