ECONNRESET Meteor - javascript

I am suddenly getting this error & there is no way I am able to trace the issue, my server keeps crashing again & again, and I haven’t done any changes in months for sure.
events.js:288
throw er; // Unhandled 'error' event
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:205:27)
Emitted 'error' event on Socket instance at:
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ECONNRESET',
code: 'ECONNRESET',
syscall: 'read'
}
Anyone facing this issue or have solution to the crash?
I tried to comment as much code as possible to avoid this issue but no luck.
Can anyone help me if this error was faced by anyone?

This problem could be due to your connection,
may be you lost your internet connection or from your server so check your server is that running properly or not

Related

HTTP 6369: SOCKET ERROR: read ECONNRESET - Node server connecting to Filemaker Data API

I have run into this error with my Node server when trying to access a Filemaker Server driven backend both locally and remotely.
HTTP 6369: SOCKET ERROR: read ECONNRESET Error: read ECONNRESET at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)
After trying everything I can find, triple-checking my FMS settings and logs, restarting the server and the machine several times, I cannot figure out what exactly is going wrong and how to solve it.
I have seen some answers to similar questions here on SO, but for the most part they just suggest catching the error in the express route (has not been changed for months and was working fine before the error), which I have done but it just outputs a more verbose version of the main error above:
HTTP 6369: SOCKET ERROR: read ECONNRESET Error: read ECONNRESET
at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)
at TLSSocket.Readable.on (_stream_readable.js:838:35)
at tickOnSocket (_http_client.js:691:10)
at onSocketNT (_http_client.js:744:5)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
at ClientRequest.onSocket (_http_client.js:732:11)
at setRequestSocket (_http_agent.js:436:7)
at handleSocketCreation_Inner (_http_agent.js:429:7)
at oncreate (_http_agent.js:286:5)
at Agent.createSocket (_http_agent.js:291:5)
at Agent.addRequest (_http_agent.js:248:10)
at new ClientRequest (_http_client.js:296:16)
at Object.request (https.js:314:10)
at Request.start (/Users/******/Documents/*****/code/******/node_modules/request/request.js:751:32)
THE ERR : Error: read ECONNRESET
at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)
at TLSSocket.Readable.on (_stream_readable.js:838:35)
at tickOnSocket (_http_client.js:691:10)
at onSocketNT (_http_client.js:744:5)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
---------------------------------------------
at ClientRequest.onSocket (_http_client.js:732:11)
at setRequestSocket (_http_agent.js:436:7)
at handleSocketCreation_Inner (_http_agent.js:429:7)
at oncreate (_http_agent.js:286:5)
at Agent.createSocket (_http_agent.js:291:5)
at Agent.addRequest (_http_agent.js:248:10)
at new ClientRequest (_http_client.js:296:16)
at Object.request (https.js:314:10)
at Request.start (/Users/********/Documents/*******/code/******/node_modules/request/request.js:751:32) {
errno: 'ECONNRESET',
code: 'ECONNRESET',
syscall:'read'
}
Also, my Node API in general had already been operating more or less seamlessly for several months of development before this problem arose. One thing was that changed on my machine was my company adding ScaleFusion device management software. I mentioned before the install that it could cause problems with the Node server API calls and the error only happened after ScaleFusion was added. Maybe it is possible the software is causing this problem?
Have been trying to find a fix for a couple of days now but running out of leads on it. If anyone can help out I'd really appreciate it. Thanks in advance for any suggestions.

Getting this socket error in discord.js and can't debug it [duplicate]

This error randomly appears When leaving my discord bot online for too long, around 3-4 hours but sometimes the error occurs sooner and sometimes later. It's really bothering me.
events.js:188
throw err;
^
Error: Unhandled "error" event. ([object Object])
at Client.emit (events.js:186:19)
at WebSocketConnection.onError (D:\BasementMonster\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:374:17)
at WebSocket.onError (D:\BasementMonster\node_modules\ws\lib\event-target.js:128:16)
at emitOne (events.js:116:13)
at WebSocket.emit (events.js:211:7)
at _receiver.cleanup (D:\BasementMonster\node_modules\ws\lib\websocket.js:211:14)
at Receiver.cleanup (D:\BasementMonster\node_modules\ws\lib\receiver.js:557:13)
at WebSocket.finalize (D:\BasementMonster\node_modules\ws\lib\websocket.js:206:20)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
I wrestled with this problem for a while in my own code. The main problem is that the trace is completely unhelpful, and that the error occurs so infrequently as to make "run it in the terminal and wait" a futile task. Eventually, I was able to figure out that the Discord.js client itself was throwing an error -- this wasn't mentioned in any of the documentation I read, so I had no handler for it -- and since this oopsie happens in the Discord.js package itself, there was no line in my code for it to point to in the trace.
What needs to exist in the code somewhere is something along the lines of
client.on('error', (err) => {
console.log(err.message)
});
This is adjusted, of course, for whatever your Client object is, and whatever you want the error handling to be.
This specific trace, as far as I can tell, comes from losing Internet connection, which is something I want to have a record of, so instead of console.log() I called my own custom function that writes the event out to a logfile with a timestamp.
Testing this by running an instance of the bot and killing my Internet connection revealed that not only did the logging function work, but that Discord.js automatically restored the bot's session after it came back. (Your mileage may vary.)
You need to add an error handling event, like this:client.on('error', console.error);

How to stop the error 'read ECONNRESET' from happening

I've made a lot of bots, hosted some on my personal laptop, and some on Heroku, but in both, I received this error that terminated node.js, so I used bot.on('error', console.error) to view the error and here's the result:
type: 'error', message: 'read ECONNRESET', error: {
Error: read ECONNRESET at TLSWrap.onStreamRead(internal / stream_base_commons.js: 111: 27) errno: 'ECONNRESET',
code: 'ECONNRESET',
syscall: 'read'
}
If anyone knows how to stop that from happening, please tell me.
"ECONNRESET" usually happens when another end of the TCP connections closes its end due to any protocol-related errors and since no one is listening to the 'error' event it gets thrown, to deal with it you should put a listener which can handle such erroneous condition.
You can refer to such exception handling here node-js-best-practice-exception-handling

Problematic socket.parser.resume() error in node.js

This bug has been crashing my node.js server for the past one week. On average it seems to occur every 12 hours. Normally when an error occurs in node.js, node.js will tell you the line number and your source file that lead to the error. However, this error is so weird that it does not let me know where the error originates from in my source codes. I can't even find _http_server.js within the entire project and node modules. As such, I have been unable to pinpoint and eliminate the bug.
Without the stack trace module 'longjohn', I would get the following error message:
socket.parser.resume()
cannot read property resume of null (_http_server.js:442)
......
After I installed 'longjohn', I obtained the following error message:
TypeError: Cannot read property 'resume' of null
at socketOnDrain (_http_server.js:442:20)
at ServerResponse.updateOutgoingData [as _onPendingData] (_http_server.js:270:14)
at ServerResponse.OutgoingMessage._send (_http_outgoing.js:128:14)
at ServerResponse.OutgoingMessage.write (_http_outgoing.js:470:16)
at ReadStream.ondata (_stream_readable.js:525:20)
at emitOne (events.js:77:13)
at ReadStream.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at ReadStream.Readable.push (_stream_readable.js:110:10)
at onread (fs.js:1744:12)
at FSReqWrap.wrapper [as oncomplete] (fs.js:576:17)
---------------------------------------------
at ReadStream.Readable.on (_stream_readable.js:655:33)
at ReadStream.Readable.pipe (_stream_readable.js:522:7)
at SendStream.stream (C:\XXXX\node_modules\express\node_modules\send\lib\send.js:533:10)
at SendStream.send (C:\XXXX\node_modules\express\node_modules\send\lib\send.js:480:8)
at C:\XXXX\node_modules\express\node_modules\send\lib\send.js:392:10
at FSReqWrap.oncomplete (fs.js:82:15)
worker 1760 died
It is worthwhile mentioning that I am using socket.io. I am also using an external service called Global Counter that displays the number of online users. I am running setInterval() in one of the workers to remove expired records.
Could someone tell me the meaning of these error messages, how the error occurs, and how I should solve it?
according to https://github.com/nodejs/node/issues/3508, you may fix this problem after upgrading nodejs to v4.2.3+ or v5.1.1+

Error: failed to connect to [localhost:27017]

When I run node app.js, I get the following error:
Failed to load c++ bson extension, using pure JS version
Express server listening on port 3000
events.js:85
throw er; // Unhandled 'error' event
^
Error: failed to connect to [localhost:27017]
at null.<anonymous> (/Users/me/development/node_modules/mongodb/lib/mongodb/connection/server.js:553:74)
at emit (events.js:118:17)
at null.<anonymous> (/Users/me/development/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
at emit (events.js:110:17)
at Socket.<anonymous> (/Users/me/developmen/node_modules/mongodb/lib/mongodb/connection/connection.js:512:10)
at Socket.emit (events.js:107:17)
at net.js:451:14
at process._tickCallback (node.js:355:11)
I'm not sure whether this is localhost problem or an issue with the connection to mongodb. I tried looking at similar questions SO and Github but it didn't help me.
Seems like mongodb server is not running. Check it

Categories

Resources