pm2
pm2 copied to clipboard
pm2 update fails with an error
What's going wrong?
pm2 update fails with the following error.
Be sure to have the latest version by doing `npm install pm2@latest -g` before doing this procedure.
>>>> In-memory PM2 is out-of-date, do:
>>>> $ pm2 update
In memory PM2 version: 5.3.0
Local PM2 version: 5.3.1
[PM2][WARN] No process found
[PM2] [v] All Applications Stopped
/root/.nvm/versions/node/v20.10.0/lib/node_modules/pm2/node_modules/@pm2/agent/src/InteractorClient.js:96
this.rpc.kill((err) => {
^
TypeError: this.rpc.kill is not a function
at /root/.nvm/versions/node/v20.10.0/lib/node_modules/pm2/node_modules/@pm2/agent/src/InteractorClient.js:96:18
at /root/.nvm/versions/node/v20.10.0/lib/node_modules/pm2/node_modules/@pm2/agent/src/InteractorClient.js:154:16
at /root/.nvm/versions/node/v20.10.0/lib/node_modules/pm2/node_modules/@pm2/agent/src/InteractorClient.js:136:16
at /root/.nvm/versions/node/v20.10.0/lib/node_modules/pm2/node_modules/pm2-axon-rpc/lib/client.js:61:5
at Parser.<anonymous> (/root/.nvm/versions/node/v20.10.0/lib/node_modules/pm2/node_modules/pm2-axon/lib/sockets/req.js:67:8)
at Parser.emit (node:events:514:28)
at Parser._write (/root/.nvm/versions/node/v20.10.0/lib/node_modules/pm2/node_modules/amp/lib/stream.js:91:16)
at writeOrBuffer (node:internal/streams/writable:556:12)
at _write (node:internal/streams/writable:490:10)
at Writable.write (node:internal/streams/writable:494:10)
Node.js v20.10.0
All my apps are running. But, pm2 list returns no process.
How could we reproduce this issue?
Sorry. I'm not sure what broke pm2. But, after my code changes, pm2 started behaving weird. pm2 list didn't return anything in the stdout. It was taking forever. I restarted the server to make it work.
Supporting information
# Run the following commands
$ pm2 report
>>>> In-memory PM2 is out-of-date, do:
>>>> $ pm2 update
In memory PM2 version: 5.3.0
Local PM2 version: 5.3.1
--- PM2 report ----------------------------------------------------------------
Date : Fri Feb 09 2024 19:47:45 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 5.3.0
node version : 20.10.0
node path : /root/.nvm/versions/node/v20.10.0/bin/pm2
argv : /root/.nvm/versions/node/v20.10.0/bin/node,/root/.nvm/versions/node/v20.10.0/lib/node_modules/pm2/lib/Daemon.js
argv0 : node
user : root
uid : 0
gid : 0
uptime : 70min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 5.3.1
node version : 20.10.0
node path : /root/.nvm/versions/node/v20.10.0/bin/pm2
argv : /root/.nvm/versions/node/v20.10.0/bin/node,/root/.nvm/versions/node/v20.10.0/bin/pm2,report
argv0 : node
user : root
uid : 0
gid : 0
===============================================================================
--- System info --------------------------------------------
arch : arm64
platform : linux
type : Linux
cpus : Neoverse-N1
cpus nb : 4
freemem : 6321065984
totalmem : 8113696768
home : /root
===============================================================================
--- PM2 list -----------------------------------------------
┌────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
└────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/root/.pm2
# setting node env
export/pm2.log last 20 lines:
PM2 | export/dump.pm2
PM2 | 2024-02-09T18:37:41: PM2 log: Concurrent actions : 2
PM2 | 2024-02-09T18:37:41: PM2 log: SIGTERM timeout : 1600
PM2 | 2024-02-09T18:37:41: PM2 log: ===============================================================================
PM2 | 2024-02-09T18:37:41: PM2 error: Error: ENOENT: no such file or directory, chmod '/root/.pm2
PM2 |
PM2 | # setting node env
PM2 | export/pub.sock'
PM2 | 2024-02-09T18:37:41: PM2 error: Error: ENOENT: no such file or directory, chmod '/root/.pm2
PM2 |
PM2 | # setting node env
PM2 | export/rpc.sock'
PM2 | 2024-02-09T19:07:59: PM2 log: App [gatekeeper:0] starting in -cluster mode-
PM2 | 2024-02-09T19:07:59: PM2 log: App [gatekeeper:0] online
PM2 | 2024-02-09T19:07:59: PM2 log: App name:gatekeeper id:0 disconnected
PM2 | 2024-02-09T19:07:59: PM2 log: App [gatekeeper:0] exited with code [0] via signal [SIGINT]
PM2 | 2024-02-09T19:09:29: PM2 log: App [gatekeeper:0] starting in -cluster mode-
PM2 | 2024-02-09T19:09:29: PM2 log: App [gatekeeper:0] online
PM2 | 2024-02-09T19:09:29: PM2 log: App name:gatekeeper id:0 disconnected
PM2 | 2024-02-09T19:09:29: PM2 log: App [gatekeeper:0] exited with code [0] via signal [SIGINT]
Please copy/paste the above report in your issue on https://github.com/Unitech/pm2/issues
Thank you in advance for any help.