0

NodeJS Express App crashes after some time. I start using npm start having start script as

start: "node app.js"

Error

at Socket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'read',
  fatal: true
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xxx@1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xxx@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

This happens when the server is up for few hours. I want to keep it up till I force stop.

I also tried this with nodemon app.js

  • May be related https://github.com/nodejs/node/issues/27916. It would be nice to share some code in order to be able to reproduce the issue. – Artyom Sokolov Sep 27 '21 at 12:08

1 Answers1

1

"ECONNRESET" means the other side of the TCP conversation abruptly closed its end of the connection. This is most probably due to one or more application protocol errors. You could look at the API server logs to see if it complains about something.

But since you are also looking for a way to check the error and potentially debug the problem, you should take a look at "How to debug a socket hang up error in NodeJS?" which was posted at stackoverflow in relation to an alike question.

Hamza Awan
  • 51
  • 2