相关文章推荐
傲视众生的硬币  ·  Thermaltronics ...·  9 月前    · 
重感情的大熊猫  ·  PHP ...·  1 年前    · 

pm2 describe fails with Cannot read property 'length' of undefined (on pm2_env.node_args) #762

@matthijskooijman

Description

I just upgraded my pm2 to version 0.10.8 (not sure what the old version was). I couldn't do a proper in-memory upgrade, since pm2 was somehow killed during the upgrade (I first did an upgrade as root without --unsafe-perms and then with --unsafe-perms, perhaps that's related). After loading a previously dumped config using pm2 resurrect , things are running again. However, the pm2 describe command now fails.

brevidiusbeheer@kia:~/.pm2/logs$ pm2 describe flash-socket-policy-server
Describing process with pid 0 - name flash-socket-policy-server
/usr/local/lib/node_modules/pm2/lib/CliUx.js:71
    { 'node v8 arguments' : pm2_env.node_args.length != 0 ? pm2_env.node_args
TypeError: Cannot read property 'length' of undefined
    at Object.UX.describeTable (/usr/local/lib/node_modules/pm2/lib/CliUx.js:71:46)
    at /usr/local/lib/node_modules/pm2/lib/CLI.js:1295:12
    at Array.forEach (native)
    at /usr/local/lib/node_modules/pm2/lib/CLI.js:1294:18
    at /usr/local/lib/node_modules/pm2/node_modules/pm2-axon-rpc/lib/client.js:45:10
    at Parser.<anonymous> (/usr/local/lib/node_modules/pm2/node_modules/pm2-axon/lib/sockets/req.js:68:8)
    at Parser.EventEmitter.emit (events.js:95:17)
    at Parser._write (/usr/local/lib/node_modules/pm2/node_modules/pm2-axon/node_modules/amp/lib/stream.js:91:16)
    at doWrite (_stream_writable.js:226:10)
    at writeOrBuffer (_stream_writable.js:216:5)

Here is the ~/.pm2/dump.pm2 file. I removed env vars and some paths (replaced
with xxx) that I didn't think were relevant (and I didn't want to expose).

[{"name":"flash-socket-policy-server","watch":true,"exec_mode":"cluster_mode","exec_interpreter":"node","env":{},"pm_exec_path":"xxx","pm_out_log_path":"xxx","pm_err_log_path":"xxx","pm_pid_path":"xxx","_":"/usr/local/bin/pm2","pm_cwd":"xxx","axm_actions":[],"restart_time":3,"unstable_restarts":0,"watcher":{"domain":null,"_events":{},"_maxListeners":10,"watched":{"xxx":["flash-socket-policy"],"xxx":["config.js.tmpl","flash-socket-policy-server.js","config.js","node_list.txt"]},"watchers":[],"enableBinaryInterval":true,"options":{"ignored":{},"persistent":false,"ignoreInitial":true,"interval":100,"binaryInterval":300,"usePolling":true,"useFsEvents":false,"ignorePermissionErrors":false},"_initialAdd":false},"created_at":1403013743396,"pm_uptime":1403013743399,"status":"online"},{"name":"nchat-server","watch":true,"exec_mode":"cluster_mode","exec_interpreter":"node","env":{},"pm_exec_path":"xxx","pm_out_log_path":"xxx","pm_err_log_path":"xxx","pm_pid_path":"xxx","pm_cwd":"xxx","axm_actions":[],"restart_time":501,"unstable_restarts":0,"watcher":{"domain":null,"_events":{},"_maxListeners":10,"watched":{"xxx":["nchat"],"xxx":["config.js","nchat-server.js"]},"watchers":[],"enableBinaryInterval":true,"options":{"ignored":{},"persistent":false,"ignoreInitial":true,"interval":100,"binaryInterval":300,"usePolling":true,"useFsEvents":false,"ignorePermissionErrors":false},"_initialAdd":false},"created_at":1406970996722,"pm_uptime":1407301225728,"status":"online"}]