Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Error [ERR_STREAM_WRITE_AFTER_END]: write after end #2774

Closed
l7s opened this issue Jun 2, 2021 · 2 comments · Fixed by #2902
Closed

[bug] Error [ERR_STREAM_WRITE_AFTER_END]: write after end #2774

l7s opened this issue Jun 2, 2021 · 2 comments · Fixed by #2902
Assignees

Comments

@l7s
Copy link

l7s commented Jun 2, 2021

Version

Build from master commit 30b48f9ed34458ceab97255f6658f3598a16e9b7

Build/Run method: Manually built (git clone - yarn install - yarn run build )

zwavejs2mqtt version: 4.5.1
zwave-js version: 7.7.1

Describe the bug

After about 5 hours of running with 32 nodes with both General and Zwave logging enabled (write to file) zwavejs2mqtt crashed living trace as below:

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at writeAfterEnd (_stream_writable.js:250:14)
    at WriteStream.Writable.write (_stream_writable.js:298:5)
    at Object.<anonymous> (/opt/zwavejs2mqtt/node_modules/file-stream-rotator/FileStreamRotator.js:616:26)
    at DailyRotateFile.log (/opt/zwavejs2mqtt/node_modules/winston-daily-rotate-file/daily-rotate-file.js:157:20)
    at DailyRotateFile._write (/opt/zwavejs2mqtt/node_modules/winston-transport/index.js:103:17)
    at doWrite (/opt/zwavejs2mqtt/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/opt/zwavejs2mqtt/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at DailyRotateFile.Writable.write (/opt/zwavejs2mqtt/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at DerivedLogger.ondata (/opt/zwavejs2mqtt/node_modules/winston/node_modules/readable-stream/lib/_stream_readable.js:681:20)
    at DerivedLogger.emit (events.js:200:13)

To Reproduce

Unable to reproduce - random crash.

Please let me know if I can provide any further info to help fix this issue.

Regards,
Chris

@l7s l7s changed the title [bug] [bug] Error [ERR_STREAM_WRITE_AFTER_END]: write after end Jun 2, 2021
@robertsLando robertsLando transferred this issue from zwave-js/zwave-js-ui Jun 3, 2021
@AlCalzone
Copy link
Member

As far as I can tell, this happens in https://github.com/winstonjs/winston-daily-rotate-file/
I should try to catch the error, but ultimately it should be fixed at the root.

@AlCalzone
Copy link
Member

Update, I think this is winstonjs/winston-daily-rotate-file#226, which is caused by an upstream dependency rogerc/file-stream-rotator#73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants