Mher
Mher

Reputation: 11

Nodejs throw error write ECONNRESET. what is the reason?

Almost once every week I get this error from the nodejs server:

Error: write ECONNRESET
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:87:16)
    at handleWriteReq (internal/stream_base_commons.js:56:21)
    at writeGeneric (internal/stream_base_commons.js:139:15)
    at TLSSocket.Socket._writeGeneric (net.js:770:11)
    at TLSSocket.Socket._write (net.js:782:8)
    at doWrite (_stream_writable.js:431:12)
    at writeOrBuffer (_stream_writable.js:415:5)
    at TLSSocket.Writable.write (_stream_writable.js:305:11)
    at abortConnection (/home/armweb/www/node_modules/engine.io/lib/server.js:509:12)
    at /home/armweb/www/node_modules/engine.io/lib/server.js:356:7 {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'write'
}

what is the reason?

Upvotes: 1

Views: 6729

Answers (1)

Kasra Ahmadi
Kasra Ahmadi

Reputation: 73

It is because your node server has not been shut down properly but you have started another node process. If you use Linux follow these steps as below:

  1. ps -aux | grep node (get node process_number)
  2. sudo kill process_number
  3. start your node process

Upvotes: 1

Related Questions