mountebank icon indicating copy to clipboard operation
mountebank copied to clipboard

:bug: `UnhandledPromiseRejectionWarning`: Error: `EACCES`: permission denied, open `mb.pid`

Open x80486 opened this issue 2 years ago • 0 comments

Expected behaviour

No startup warnings/errors.

Actual behaviour

(node:1) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open 'mb.pid'
    at Object.openSync (fs.js:497:3)
    at Object.writeFileSync (fs.js:1528:35)
    at Object.start (/usr/local/lib/node_modules/mountebank/bin/mb:53:12)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Steps to reproduce

Run Mountebank's image docker.io/bbyars/mountebank:2.6.0.

Software versions used

OS         : Arch Linux
mountebank : 2.6.0
node.js    : - (only if installed via npm)
Installation method : - (npm, zip, tar, pkg, deb, rpm)

Log contents in mb.log when running mb --loglevel debug

$ docker logs mountebank --follow 
warn: [mb:2525] Running with --allowInjection set. See http://localhost:2525/docs/security for security info
info: [mb:2525] mountebank v2.6.0 now taking orders - point your browser to http://localhost:2525/ for help
debug: [mb:2525] config: {"options":{"allowInjection":true,"allow-injection":true,"configfile":"/app/config/imposters.ejs","port":2525,"noParse":false,"no-parse":false,"formatter":"mountebank-formatters","pidfile":"mb.pid","localOnly":false,"local-only":false,"ipWhitelist":["*"],"ip-whitelist":"*","mock":false,"debug":false,"heroku":false,"protofile":"protocols.json","origin":false,"log":{"level":"debug","transports":{"console":{"colorize":true,"format":"%level: %message"},"file":{"path":"mb.log","format":"json"}}}},"process":{"nodeVersion":"v14.19.0","architecture":"x64","platform":"linux"}}
info: [mb:2525] PUT /imposters
debug: [mb:2525] ::ffff:127.0.0.1:54542 => {"imposters":[{...}]}
info: [http:8090 characters-api.create-character] Open for business...
(node:1) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open 'mb.pid'
    at Object.openSync (fs.js:497:3)
    at Object.writeFileSync (fs.js:1528:35)
    at Object.start (/usr/local/lib/node_modules/mountebank/bin/mb:53:12)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

x80486 avatar Mar 31 '22 21:03 x80486