When I run pm2 start <app>, the process hangs after logging [PM2] Starting <app> in fork_mode (1 instance)
Running Ubuntu 14.04, Node v6.2.0, and pm2@latest
pm2.log:
2016-06-05 15:59:27: [PM2][WORKER] Started with refreshing interval: 30000
2016-06-05 15:59:27: [[[[ PM2/God daemon launched ]]]]
2016-06-05 15:59:27: BUS system [READY] on port /root/.pm2/pub.sock
2016-06-05 15:59:27: RPC interface [READY] on port /root/.pm2/rpc.sock
2016-06-05 15:59:27: Starting execution sequence in -fork mode- for app name:splash id:0
2016-06-05 15:59:27: App name:splash id:0 online
2016-06-05 15:59:27: [PM2] Error caught by domain:
TypeError: obj.hasOwnProperty is not a function
at safeDeepClone (/usr/local/lib/node_modules/pm2/lib/tools/safeclonedeep.js:49:13)
at safeDeepClone (/usr/local/lib/node_modules/pm2/lib/tools/safeclonedeep.js:53:22)
at safeDeepClone (/usr/local/lib/node_modules/pm2/lib/tools/safeclonedeep.js:53:22)
at cloneWrap (/usr/local/lib/node_modules/pm2/lib/tools/safeclonedeep.js:65:10)
at Object.module.exports.clone (/usr/local/lib/node_modules/pm2/lib/Utility.js:42:12)
at Object.Common.deepCopy.Common.serialize.Common.clone (/usr/local/lib/node_modules/pm2/lib/Common.js:201:18)
at /usr/local/lib/node_modules/pm2/lib/God.js:372:25
at forkMode (/usr/local/lib/node_modules/pm2/lib/God.js:229:15)
at /usr/local/lib/node_modules/pm2/lib/God/ForkMode.js:210:22
at /usr/local/lib/node_modules/pm2/node_modules/async/lib/async.js:52:16
2016-06-05 15:59:27: [PM2] Trying to update PM2...
Be sure to have the latest version by doing npm install pm2@latest -g before doing this procedure.
/usr/local/lib/node_modules/pm2/lib/tools/safeclonedeep.js:49
if (obj.hasOwnProperty(attr)) {
^
TypeError: obj.hasOwnProperty is not a function
at safeDeepClone (/usr/local/lib/node_modules/pm2/lib/tools/safeclonedeep.js:49:13)
at safeDeepClone (/usr/local/lib/node_modules/pm2/lib/tools/safeclonedeep.js:53:22)
at safeDeepClone (/usr/local/lib/node_modules/pm2/lib/tools/safeclonedeep.js:53:22)
at cloneWrap (/usr/local/lib/node_modules/pm2/lib/tools/safeclonedeep.js:65:10)
at Object.module.exports.clone (/usr/local/lib/node_modules/pm2/lib/Utility.js:42:12)
at Object.Common.deepCopy.Common.serialize.Common.clone (/usr/local/lib/node_modules/pm2/lib/Common.js:201:18)
at Object.getFormatedProcesses (/usr/local/lib/node_modules/pm2/lib/God/Methods.js:68:21)
at getMonitorData (/usr/local/lib/node_modules/pm2/lib/God/ActionMethods.js:42:25)
at Server.onmessage (/usr/local/lib/node_modules/pm2/node_modules/pm2-axon-rpc/lib/server.js:105:6)
at emitTwo (events.js:106:13)
2016-06-05 16:04:07: [PM2][WORKER] Started with refreshing interval: 30000
2016-06-05 16:04:07: [[[[ PM2/God daemon launched ]]]]
2016-06-05 16:04:07: BUS system [READY] on port /root/.pm2/pub.sock
2016-06-05 16:04:07: RPC interface [READY] on port
Run the following commands.
sudo apt-get update # Fetches the list of available updates
sudo apt-get upgrade # Strictly upgrades the current packages
sudo apt-get dist-upgrade # Installs updates (new ones)
Then.
sudo npm install pm2@latest -g
Then
pm2 delete all
pm2 update
sudo reboot
pm2 -v
You should get
1.1.3
That will solve your issue. At least it did for me on the same OS.
Thanks for the suggestions! My problem ended up being because there were two versions installed, one in /usr/local/bin and one in /usr/bin. The older version was listed first in my $PATH variable.
Most helpful comment
Thanks for the suggestions! My problem ended up being because there were two versions installed, one in /usr/local/bin and one in /usr/bin. The older version was listed first in my $PATH variable.