Skip to content

EACCESS error is masked with ERR_MULTIPLE_CALLBACK error #36

@rooftopsparrow

Description

@rooftopsparrow

Hi!

I was looking at an issue in a new deployment which was crashing on startup and the only error present in the stderr logs was ERR_MULTIPLE_CALLBACK from rotating-file-stream.

After patching the utils.js file with an error log to print out where I suspected the error was occurring, I uncovered the real error:

ERROR: { [Error: EACCES: permission denied, mkdir 'log']
  [stack]: 'Error: EACCES: permission denied, mkdir \'log\'',
  [message]: 'EACCES: permission denied, mkdir \'log\'',
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: 'log' }
_stream_writable.js:456
    throw new ERR_MULTIPLE_CALLBACK();
    ^
Error [ERR_MULTIPLE_CALLBACK]: Callback called multiple times
    at onwrite (_stream_writable.js:456:11)
    at RotatingFileStream._rewrite (/opt/service/node_modules/rotating-file-stream/index.js:66:66)
    at RotatingFileStream._write (/opt/service/node_modules/rotating-file-stream/index.js:100:7)
    at doWrite (_stream_writable.js:415:12)
    at clearBuffer (_stream_writable.js:545:7)
    at onwrite (_stream_writable.js:470:7)
    at RotatingFileStream._rewrite (/opt/service/node_modules/rotating-file-stream/index.js:66:66)
    at RotatingFileStream.end (/opt/service/node_modules/rotating-file-stream/index.js:127:12)
    at RotatingFileStream.<anonymous> (/opt/service/node_modules/rotating-file-stream/utils.js:216:8)
    at Object.onceWrapper (events.js:286:20)

Furthermore, the error event was not fired. This is on nodejs v10.16.0. I will try to make a PR with a failing test to replicate this behavior.

Thanks for your module!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions