Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

node.js - ECONNRESET Aborted error randomly during node process

My node js application ( a discord bot ) keeps crashing with the Error: aborted message and code ECONNRESET. I have some some digging and it seems that the issue occurs when the other end of a TCP connection hangs up abruptly.

The error message I always get:

Error: aborted
    at connResetException (node:internal/errors:631:14)
    at TLSSocket.socketCloseListener (node:_http_client:438:27)
    at TLSSocket.emit (node:events:388:22)
    at node:net:666:12
    at TCP.done (node:_tls_wrap:573:7) {
code: 'ECONNRESET'
}

As you can see the error message is not very useful and doesn't provide any informatino as to where the error happened. I am getting the error through the node process.on('uncaughtException', err => {}) exception handler.

I am using discord.js ^12.5.1 node 15.4.0 and axios ^0.21.1 although the error seems to occur randomly and looking through the logs there is never a specific function call that triggers it and sometimes it happens whilst no functions have even been called.

The error happens sporadically as well. Sometimes it happens once a day and other times it will happen 5 times in an hour.

I should also add I am using the Heroku free tier for hosting,

If anyone could shed some light that would be very useful.

question from:https://stackoverflow.com/questions/65898196/econnreset-aborted-error-randomly-during-node-process

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...