node-bunyan icon indicating copy to clipboard operation
node-bunyan copied to clipboard

Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed

Open ghost opened this issue 4 years ago • 2 comments

@trentm Bunyan logger crashes the Nodejs Docker container under an uncaught exception. The frequency of the crashes is high and each time we get the same error i.e stream destroyed. I'm not sure whether it's a library limitation or any undesired behavior in some particular cases. The try-catch block not able to catch the error generated under stream destroyed call and that pop-up the process uncaught exception handler Env details : Node: 10 "bunyan": "^1.8.12"

I have attached the exact log before the container crashes.

{ "timestamp": 1598837539123, "message": "events.js:174", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " throw er; // Unhandled 'error' event", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " ^", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": "Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " at doWrite (_stream_writable.js:411:19)", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " at writeOrBuffer (_stream_writable.js:399:5)", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " at WriteStream.Writable.write (_stream_writable.js:299:11)", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " at Logger._emit (/usr/src/app/node_modules/bunyan/lib/bunyan.js:923:22)", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " at Logger.fatal (/usr/src/app/node_modules/bunyan/lib/bunyan.js:1045:24)", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " at process.on (/usr/src/app/src/server.js:59:9)", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " at process.emit (events.js:203:15)", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " at process.EventEmitter.emit (domain.js:448:20)", "ingestionTime": 1598837539286 }, { "timestamp": 1598837539123, "message": " at process._fatalException (internal/bootstrap/node.js:497:27)", "ingestionTime": 1598837539286 }

ghost avatar Aug 31 '20 18:08 ghost

did you figure it out this one ?

gcarreto avatar Nov 19 '21 20:11 gcarreto

Hi @trentm , I have the same issue

MattiaGeccheleAxa avatar May 02 '23 14:05 MattiaGeccheleAxa