Skip to content

PM2 daemon exception cause unexpected restart of my cluster app #4558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ouraios opened this issue Dec 27, 2019 · 2 comments
Closed

PM2 daemon exception cause unexpected restart of my cluster app #4558

ouraios opened this issue Dec 27, 2019 · 2 comments
Labels

Comments

@ouraios
Copy link

ouraios commented Dec 27, 2019

What's going wrong?

PM2 deamon log have a weird error which cause the restart of my cluster app with some downtime

How could we reproduce this issue?

I dont know about that, i have searched on here if there was a related issue but there's none.

Supporting information

--- PM2 report ----------------------------------------------------------------
Date                 : Fri Dec 27 2019 13:58:21 GMT+0100 (GMT+01:00)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 4.2.1
node version         : 12.13.0
node path            : /home/ouraios/.npm-packages/bin/pm2
argv                 : /usr/bin/node,/home/ouraios/.npm-packages/lib64/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : ouraios
uid                  : 1001
gid                  : 100
uptime               : 13074min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 4.2.1
node version         : 12.13.0
node path            : /home/ouraios/.npm-packages/bin/pm2
argv                 : /usr/bin/node,/home/ouraios/.npm-packages/bin/pm2,report
argv0                : node
user                 : ouraios
uid                  : 1001
gid                  : 100
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : Intel(R) Xeon(R) E-2136 CPU @ 3.30GHz
cpus nb              : 8
freemem              : 32083566592
totalmem             : 42949672960
home                 : /home/ouraios
===============================================================================
--- PM2 list -----------------------------------------------
┌─────┬───────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name          │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼───────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0   │ API_PROD      │ default     │ 0.0.0   │ cluster │ 26593    │ 5m     │ 29   │ online    │ 29.7%    │ 576.7mb  │ ouraios │ disabled │
│ 1   │ API_PROD      │ default     │ 0.0.0   │ cluster │ 26905    │ 3m     │ 34   │ online    │ 15.8%    │ 502.1mb  │ ouraios │ disabled │
│ 6   │ API_REVIEW    │ default     │ 0.0.0   │ cluster │ 24859    │ 2D     │ 3    │ online    │ 0%       │ 171.3mb  │ ouraios │ disabled │
│ 7   │ API_REVIEW    │ default     │ 0.0.0   │ cluster │ 24877    │ 2D     │ 3    │ online    │ 0.2%     │ 169.6mb  │ ouraios │ disabled │
└─────┴───────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/ouraios/.pm2/pm2.log last 20 lines:
PM2        |     at AsyncHook.before (domain.js:79:20)
PM2        |     at emitHook (internal/async_hooks.js:164:38)
PM2        | 2019-12-27T13:43:02: PM2 log: App name:API_PROD id:0 disconnected
PM2        | 2019-12-27T13:43:02: PM2 log: App [API_PROD:0] exited with code [1] via signal [SIGINT]
PM2        | 2019-12-27T13:43:02: PM2 log: App [API_PROD:0] starting in -cluster mode-
PM2        | 2019-12-27T13:43:02: PM2 log: App [API_PROD:0] online
PM2        | TypeError: Cannot read property 'enter' of undefined
PM2        |     at AsyncHook.before (domain.js:79:20)
PM2        |     at emitHook (internal/async_hooks.js:164:38)
PM2        | 2019-12-27T13:53:08: PM2 log: App name:API_PROD id:0 disconnected
PM2        | 2019-12-27T13:53:08: PM2 log: App [API_PROD:0] exited with code [1] via signal [SIGINT]
PM2        | 2019-12-27T13:53:08: PM2 log: App [API_PROD:0] starting in -cluster mode-
PM2        | 2019-12-27T13:53:08: PM2 log: App [API_PROD:0] online
PM2        | TypeError: Cannot read property 'enter' of undefined
PM2        |     at AsyncHook.before (domain.js:79:20)
PM2        |     at emitHook (internal/async_hooks.js:164:38)
PM2        | 2019-12-27T13:55:07: PM2 log: App name:API_PROD id:1 disconnected
PM2        | 2019-12-27T13:55:07: PM2 log: App [API_PROD:1] exited with code [1] via signal [SIGINT]
PM2        | 2019-12-27T13:55:07: PM2 log: App [API_PROD:1] starting in -cluster mode-
PM2        | 2019-12-27T13:55:07: PM2 log: App [API_PROD:1] online

@ouraios
Copy link
Author

ouraios commented Dec 27, 2019

It seems like its related to a NodeJS issue on version 12 : nodejs/node#30122
And the fix will deployed in V12.14.1 nodejs/node#31069

For now i dont recommend using PM2 with version > 12.3 and < 12.14.1 and that was my case using the last stable release of node on gentoo (https://packages.gentoo.org/packages/net-libs/nodejs) which currently is 12.13

@ouraios ouraios closed this as completed Dec 27, 2019
@ouraios ouraios reopened this Dec 27, 2019
@stale
Copy link

stale bot commented May 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 23, 2020
@stale stale bot closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant