Issue with Args dropping off after a restart
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?
We use PM2 to run a custom CLI application that takes in specific arguments. We're using the ecosystem.config.js file to define our PM2 application and typically our script is the whole command. For example, we might run cli foo -d bar. On some systems, very rarely, we've run into an issue where the args disappear after the system reboots, just running cli. On those systems, we have added the args attribute to the ecosystem.config.js file and moved our arguments there. Everything seems to work fine after that.
I'm wondering if we should move all of our systems to the use the args attribute. Is that the preferred method? Why would it work on some systems but not the other?
How could we reproduce this issue?
I am unsure. We've been running this on RHEL system with Node 18. I can't reproduce it consistently.
Supporting information
# Run the following commands
$ pm2 report
This was run on one of our systems that had the issue, but we subsequently fixed. If we need to break it again, we can try.
--- PM2 report ----------------------------------------------------------------
Date : Wed Oct 23 2024 18:13:28 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 5.4.2
node version : 18.20.4
node path : not found
argv : /home/pantomath/.nvm/versions/node/v18.20.4/bin/node,/home/pantomath/.nvm/versions/node/v18.20.4/lib/node_modules/pm2/lib/Daemon.js
argv0 : node
user : pantomath
uid : 1001
gid : 1001
uptime : 3min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 5.4.2
node version : 18.20.4
node path : /home/pantomath/.nvm/versions/node/v18.20.4/bin/pm2
argv : /home/pantomath/.nvm/versions/node/v18.20.4/bin/node,/home/pantomath/.nvm/versions/node/v18.20.4/bin/pm2,report
argv0 : node
user : pantomath
uid : 1001
gid : 1001
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : linux
type : Linux
cpus : Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
cpus nb : 2
freemem : 3129499648
totalmem : 4093984768
home : /home/pantomath
===============================================================================
--- PM2 list -----------------------------------------------
┌────┬──────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├────┼──────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ pantomath │ default │ 0.39.7 │ cluster │ 2296 │ 3m │ 0 │ online │ 0.1% │ 113.0mb │ pan… │ disabled │
└────┴──────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/pantomath/.pm2/pm2.log last 20 lines:
PM2 | 2024-10-23T18:09:14: PM2 log: pid=2261 msg=process killed
PM2 | 2024-10-23T18:09:14: PM2 log: PM2 successfully stopped
PM2 | 2024-10-23T18:10:10: PM2 log: ===============================================================================
PM2 | 2024-10-23T18:10:11: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
PM2 | 2024-10-23T18:10:11: PM2 log: Time : Wed Oct 23 2024 18:10:11 GMT+0000 (Coordinated Universal Time)
PM2 | 2024-10-23T18:10:11: PM2 log: PM2 version : 5.4.2
PM2 | 2024-10-23T18:10:11: PM2 log: Node.js version : 18.20.4
PM2 | 2024-10-23T18:10:11: PM2 log: Current arch : x64
PM2 | 2024-10-23T18:10:11: PM2 log: PM2 home : /home/pantomath/.pm2
PM2 | 2024-10-23T18:10:11: PM2 log: PM2 PID file : /home/pantomath/.pm2/pm2.pid
PM2 | 2024-10-23T18:10:11: PM2 log: RPC socket file : /home/pantomath/.pm2/rpc.sock
PM2 | 2024-10-23T18:10:11: PM2 log: BUS socket file : /home/pantomath/.pm2/pub.sock
PM2 | 2024-10-23T18:10:11: PM2 log: Application log path : /home/pantomath/.pm2/logs
PM2 | 2024-10-23T18:10:11: PM2 log: Worker Interval : 30000
PM2 | 2024-10-23T18:10:11: PM2 log: Process dump file : /home/pantomath/.pm2/dump.pm2
PM2 | 2024-10-23T18:10:11: PM2 log: Concurrent actions : 2
PM2 | 2024-10-23T18:10:11: PM2 log: SIGTERM timeout : 1600
PM2 | 2024-10-23T18:10:11: PM2 log: ===============================================================================
PM2 | 2024-10-23T18:10:11: PM2 log: App [pantomath:0] starting in -cluster mode-
PM2 | 2024-10-23T18:10:11: PM2 log: App [pantomath:0] 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 with the ecosystem.config.js application definition and the reboot workflow, then use pm2 report to compare the command and arguments before and after restart. Done means establishing a reproducible explanation for the arguments disappearing, or confirming the supported configuration approach and documenting the result.
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
- 25/100