You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pm2's home directory exists, but is empty, pm2 should automatically create the logs and pids directories instead of failing to start:
$ PM2_HOME=/tmp/foo pm2 start app.js --no-daemon
[...]
pm2 launched in no-daemon mode (you can add DEBUG="*" env variable to get more messages)
2016-09-23 17:20:24: Launching in no daemon mode
2016-09-23 17:20:24: [PM2] Starting /app/app.js in fork_mode (1 instance)
2016-09-23 17:20:24: Starting execution sequence in -fork mode- for app name:app id:0
2016-09-23 17:20:24: App name:app id:0 online
2016-09-23 17:20:24: [PM2] Done.
2016-09-23 17:20:24: ┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬───────────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
├──────────┼────┼──────┼─────┼────────┼─────────┼────────┼─────┼───────────┼──────────┤
│ app │ 0 │ fork │ 218 │ online │ 0 │ 0s │ 11% │ 23.3 MB │ disabled │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴───────────┴──────────┘
2016-09-23 17:20:24: Use `pm2 show <id|name>` to get more details about an app
2016-09-23 17:20:24: --no-daemon option enabled = do not exit pm2 API
2016-09-23 17:20:24: PM2 daemon PID = 208
2016-09-23 17:20:24: [STREAMING] Now streaming realtime logs for [all] processes
17:20:24 0|app | Port: 8888
Actual behaviour
pm2 launched in no-daemon mode (you can add DEBUG="*" env variable to get more messages)
2016-09-23 17:15:22: Launching in no daemon mode
2016-09-23 17:15:22: [PM2] Starting /app/app.js in fork_mode (1 instance)
2016-09-23 17:15:22: Starting execution sequence in -fork mode- for app name:app id:0
2016-09-23 17:15:22: Trace: { Error: ENOENT: no such file or directory, open '/tmp/foo/logs/app-out-0.log'
at Error (native)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/tmp/foo/logs/app-out-0.log' }
at Object.God.logAndGenerateError (/app/.global/lib/node_modules/pm2/lib/God/Methods.js:51:15)
at /app/.global/lib/node_modules/pm2/lib/God/ForkMode.js:89:13
at /app/.global/lib/node_modules/pm2/node_modules/async/lib/async.js:52:16
at /app/.global/lib/node_modules/pm2/node_modules/async/lib/async.js:696:30
at /app/.global/lib/node_modules/pm2/node_modules/async/lib/async.js:167:37
at /app/.global/lib/node_modules/pm2/node_modules/async/lib/async.js:1209:30
at WriteStream.<anonymous> (/app/.global/lib/node_modules/pm2/lib/Utility.js:137:13)
at emitOne (events.js:96:13)
at WriteStream.emit (events.js:188:7)
at WriteStream.<anonymous> (fs.js:2089:12)
2016-09-23 17:15:22: [PM2] Done.
2016-09-23 17:15:22: ┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────────┘
2016-09-23 17:15:22: Use `pm2 show <id|name>` to get more details about an app
2016-09-23 17:15:22: --no-daemon option enabled = do not exit pm2 API
2016-09-23 17:15:22: PM2 daemon PID = 197
2016-09-23 17:15:22: [STREAMING] Now streaming realtime logs for [all] processes
Note that the app is missing from the output.
Software versions used
OS : Debian Jessie
node.js : 6.6.0
PM2 : 2.0.12 is when the bug was introduced, 1.1.3 doesn't exhibit this behaviour
The text was updated successfully, but these errors were encountered:
Steps to reproduce
Startup fails if the home directory exists already, but is empty:
Expected behaviour
When pm2's home directory exists, but is empty, pm2 should automatically create the logs and pids directories instead of failing to start:
Actual behaviour
Note that the app is missing from the output.
Software versions used
The text was updated successfully, but these errors were encountered: