pm2 daemon is killed every hour
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
pm2 gets killed every hour. The running processes get killed and are restarted (through the pm2 startup script). This happens every hour.
There is no error log in pm2.log. This happens exactly every hour (UTC time).
Supporting information
$ pm2 report
--- PM2 report ----------------------------------------------------------------
Date : Tue Jan 19 2021 12:15:41 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 4.5.1
node version : 14.15.1
node path : not found
argv : /home/ubuntu/.nvm/versions/node/v14.15.1/bin/node,/home/ubuntu/.nvm/versions/node/v14.15.1/lib/node_modules/pm2/lib/Daemon.js
argv0 : node
user : ubuntu
uid : 1000
gid : 1000
uptime : 15min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 4.5.1
node version : 14.15.1
node path : /home/ubuntu/.nvm/versions/node/v14.15.1/bin/pm2
argv : /home/ubuntu/.nvm/versions/node/v14.15.1/bin/node,/home/ubuntu/.nvm/versions/node/v14.15.1/bin/pm2,report
argv0 : node
user : ubuntu
uid : 1000
gid : 1000
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : linux
type : Linux
cpus : AMD EPYC 7B12
cpus nb : 8
freemem : 15124996096
totalmem : 16789950464
home : /home/ubuntu
===============================================================================
--- PM2 list -----------------------------------------------
┌─────┬──────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼──────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 1 │ exporter │ default │ 1.0.0 │ cluster │ 2118 │ 15m │ 0 │ online │ 0.2% │ 60.4mb │ ubuntu │ disabled │
│ 2 │ exporter │ default │ 1.0.0 │ cluster │ 2124 │ 15m │ 0 │ online │ 0.4% │ 60.3mb │ ubuntu │ disabled │
└─────┴──────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
Module
┌────┬───────────────────────────────────────┬────────────────────┬───────┬──────────┬──────┬──────────┬──────────┬──────────┐
│ id │ module │ version │ pid │ status │ ↺ │ cpu │ mem │ user │
├────┼───────────────────────────────────────┼────────────────────┼───────┼──────────┼──────┼──────────┼──────────┼──────────┤
│ 0 │ pm2-logrotate │ 2.7.0 │ 2107 │ online │ 0 │ 0.2% │ 43.6mb │ ubuntu │
└────┴───────────────────────────────────────┴────────────────────┴───────┴──────────┴──────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/ubuntu/.pm2/pm2.log last 20 lines:
PM2 | 2021-01-19T12:00:02: PM2 log: Time : Tue Jan 19 2021 12:00:02 GMT+0000 (Coordinated Universal Time)
PM2 | 2021-01-19T12:00:02: PM2 log: PM2 version : 4.5.1
PM2 | 2021-01-19T12:00:02: PM2 log: Node.js version : 14.15.1
PM2 | 2021-01-19T12:00:02: PM2 log: Current arch : x64
PM2 | 2021-01-19T12:00:02: PM2 log: PM2 home : /home/ubuntu/.pm2
PM2 | 2021-01-19T12:00:02: PM2 log: PM2 PID file : /home/ubuntu/.pm2/pm2.pid
PM2 | 2021-01-19T12:00:02: PM2 log: RPC socket file : /home/ubuntu/.pm2/rpc.sock
PM2 | 2021-01-19T12:00:02: PM2 log: BUS socket file : /home/ubuntu/.pm2/pub.sock
PM2 | 2021-01-19T12:00:02: PM2 log: Application log path : /home/ubuntu/.pm2/logs
PM2 | 2021-01-19T12:00:02: PM2 log: Worker Interval : 30000
PM2 | 2021-01-19T12:00:02: PM2 log: Process dump file : /home/ubuntu/.pm2/dump.pm2
PM2 | 2021-01-19T12:00:02: PM2 log: Concurrent actions : 2
PM2 | 2021-01-19T12:00:02: PM2 log: SIGTERM timeout : 1600
PM2 | 2021-01-19T12:00:02: PM2 log: ===============================================================================
PM2 | 2021-01-19T12:00:02: PM2 log: App [pm2-logrotate:0] starting in -fork mode-
PM2 | 2021-01-19T12:00:02: PM2 log: App [pm2-logrotate:0] online
PM2 | 2021-01-19T12:00:02: PM2 log: App [exporter:1] starting in -cluster mode-
PM2 | 2021-01-19T12:00:02: PM2 log: App [exporter:2] starting in -cluster mode-
PM2 | 2021-01-19T12:00:02: PM2 log: App [exporter:1] online
PM2 | 2021-01-19T12:00:02: PM2 log: App [exporter:2] online
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the hourly restart and inspect the pm2 startup script, Daemon.js entry point, and pm2.log around the UTC failure time. Use the supplied pm2 report to compare daemon uptime and process state; done means identifying why the daemon is killed and verifying that managed processes remain running across the hourly interval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100