Reputation: 255
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.
Upvotes: 9
Views: 86026
Reputation: 1
ECONNRESET errors in Heroku typically occur when there is an issue communicating between the client and the server. This can be caused by long file upload queries that exceed the server's timeout limit for the query, causing the server to close the connection before it can be properly terminated. Other possible causes of the error are network latency issues, problems with the Heroku application itself (e.g. memory leaks), or configuration changes to the server.
Try Checking your Heroku Account to set the server timeout limit. You might have to upgrade...
Upvotes: 0
Reputation: 643
"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
Upvotes: 18