pm2 verison 2.0.12
node version 4.5.0
OS
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
CPU : 2
MEM: 2G
pm2 ls
โโโโโโโโโโโโโฌโโโโโฌโโโโโโโโโโฌโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ mode โ pid โ status โ restart โ uptime โ cpu โ mem โ watching โ
โโโโโโโโโโโโโผโโโโโผโโโโโโโโโโผโโโโโโโโผโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโผโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโโค
โ qtp โ 1 โ cluster โ 5469 โ online โ 103 โ 19m โ 0% โ 129.3 MB โ disabled โ
โ qtp โ 2 โ cluster โ 5463 โ online โ 102 โ 19m โ 0% โ 126.6 MB โ disabled โ
โ qtpayment โ 3 โ fork โ 19181 โ online โ 2 โ 25h โ 0% โ 70.6 MB โ disabled โ
โโโโโโโโโโโโโดโโโโโดโโโโโโโโโโดโโโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโ
Module activated
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโฌโโโโโโโโโโโโโโ
โ Module โ version โ target PID โ status โ restart โ cpu โ memory โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโผโโโโโโผโโโโโโโโโโโโโโค
โ pm2-logrotate โ 2.0.0 โ 14626 โ online โ 1 โ 0% โ 52.492 MB โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโดโโโโโโโโโโโโโโ
Use `pm2 show <id|name>` to get more details about an app
run command : tail --lines 50 ~/.pm2/pm2.log
2016-09-28 12:46:13: App name:qtp id:2 disconnected
2016-09-28 12:46:13: App [qtp] with id [2] and pid [9838], exited with code [0] via signal [SIGINT]
2016-09-28 12:46:13: Starting execution sequence in -cluster mode- for app name:qtp id:2
2016-09-28 12:46:13: App name:qtp id:2 online
2016-09-28 13:00:02: App name:qtp id:1 disconnected
2016-09-28 13:00:02: App [qtp] with id [1] and pid [9817], exited with code [0] via signal [SIGINT]
2016-09-28 13:00:02: Starting execution sequence in -cluster mode- for app name:qtp id:1
2016-09-28 13:00:02: App name:qtp id:1 online
2016-09-28 13:00:03: App name:qtp id:2 disconnected
2016-09-28 13:00:03: App [qtp] with id [2] and pid [16331], exited with code [0] via signal [SIGINT]
2016-09-28 13:00:03: Starting execution sequence in -cluster mode- for app name:qtp id:2
2016-09-28 13:00:03: App name:qtp id:2 online
2016-09-28 13:03:30: App name:qtp id:1 disconnected
2016-09-28 13:03:30: App [qtp] with id [1] and pid [17704], exited with code [0] via signal [SIGINT]
2016-09-28 13:03:30: Starting execution sequence in -cluster mode- for app name:qtp id:1
2016-09-28 13:03:30: App name:qtp id:1 online
2016-09-28 13:03:30: App name:qtp id:2 disconnected
2016-09-28 13:03:30: App [qtp] with id [2] and pid [17718], exited with code [0] via signal [SIGINT]
2016-09-28 13:03:30: Starting execution sequence in -cluster mode- for app name:qtp id:2
2016-09-28 13:03:30: App name:qtp id:2 online
2016-09-28 15:21:20: App name:qtp id:2 disconnected
2016-09-28 15:21:20: App [qtp] with id [2] and pid [18116], exited with code [0] via signal [SIGINT]
2016-09-28 15:21:20: Starting execution sequence in -cluster mode- for app name:qtp id:2
2016-09-28 15:21:20: App name:qtp id:1 disconnected
2016-09-28 15:21:20: App [qtp] with id [1] and pid [18092], exited with code [0] via signal [SIGINT]
2016-09-28 15:21:20: Starting execution sequence in -cluster mode- for app name:qtp id:1
2016-09-28 15:21:20: App name:qtp id:2 online
2016-09-28 15:21:20: App name:qtp id:1 online
2016-09-28 16:27:21: App name:qtp id:2 disconnected
2016-09-28 16:27:21: App [qtp] with id [2] and pid [31433], exited with code [0] via signal [SIGINT]
2016-09-28 16:27:21: Starting execution sequence in -cluster mode- for app name:qtp id:2
2016-09-28 16:27:21: App name:qtp id:1 disconnected
2016-09-28 16:27:21: App [qtp] with id [1] and pid [31439], exited with code [0] via signal [SIGINT]
2016-09-28 16:27:21: Starting execution sequence in -cluster mode- for app name:qtp id:1
2016-09-28 16:27:21: App name:qtp id:2 online
2016-09-28 16:27:21: App name:qtp id:1 online
please help me , thank you so much
What's the problem exactly ? pm2 restart application as soon as they die, thats the normal behavior.
why do always restart the application ? what is that reason ? Another 'qtpayment' only restart twice ใIf that's normal behavior as restarted many times , I don't understand that pm2 designing style ..
There are two reasons pm2 restart an application :
unhandledException exception is thrown but not catched by the application, in case the application crash.unhandledRejection promise is rejected but not catched by the application.You're problem might come from the fact that you aren't handling promise rejection, but be sure that your application doesnt crash because of an unhandledException (check in your application logs).
ok , thank you so much . Expect perfect designing .
@justquanyin Could you try using last build :
$ npm install pm2@next -g
$ pm2 update
I do not think it's gonna fix your issue, as you were using PM2 2.0.12.
Would it be possible to share with us some code so we can reproduce that issue?
I'm having the same issue. Constant restarts with the absolute latest version.
It started doing this when I used the following:
var P = require('bluebird');
P.onPossiblyUnhandledRejection(function () {});
To clarify, I am using this because I am getting tons of warnings and my logs are growing huge. Meanwhile I am trying to figure out what is causing the warnings. Yet so far there is no change in my application (NODE 6.7.0) it's only pm2 that's not having a good time with this.
@petergi Can you confirm that the version of pm2 that you are using (daemon and CLI) are 2.0.16 ?
No they are 2.0.15.
Update to 2.0.16 and it "seems" fine so far. I'll keep on I on it for the next few hours, but the behaviour is much better.
Thanks!
@Unitech So sorry . I can't give us total code , but some code maybe not reproduce that issue .
I need observe much logs and find reason to made crash or exception . After that , I will consult us . Thank you for your answer .
[email protected] with fix published
$ npm install pm2@latest -g
Most helpful comment
What's the problem exactly ? pm2 restart application as soon as they die, thats the normal behavior.