Replace Node.js process.kill by treeKill
Bug: pid can not be killed Error: kill ESRCH
Update available ([email protected] - latest stable):
$ npm install pm2@latest -g
$ pm2 update
Please re-open this issue if you notice any problem,
I've had this occur on a recent version of pm2. The app that crashed is #3, and has been renamed to APPNAME for privacy reasons. Unrelated applications renamed to APP. As you can see, I had to run pm2 update, and then kill it after it hung, before running it again.
If this occurs again, is there anything I can do to log with additional verbosity when running pm2 update? Might be able to determine what causes it to hang, and perhaps that would aid in root cause analysis.
pm2 -v
2.10.1
$ pm2 start APPNAME
[PM2] Applying action restartProcessId on app APPNAME
[PM2][ERROR] Process 3 not found
โโโโโโโโโโโโโโโโโโโฌโโโโโฌโโโโโโโฌโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ mode โ pid โ status โ restart โ uptime โ cpu โ mem โ user โ watching โ
โโโโโโโโโโโโโโโโโโโผโโโโโผโโโโโโโผโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโผโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโค
โ APP โ 1 โ fork โ 14625 โ online โ 1 โ 11D โ 0% โ 52.1 MB โ user โ disabled โ
โ APP โ 2 โ fork โ 1819 โ online โ 436 โ 39h โ 0% โ 127.4 MB โ user โ disabled โ
โ APP โ 4 โ fork โ 5412 โ online โ 0 โ 20D โ 0% โ 44.4 MB โ user โ disabled โ
โ APP โ 0 โ fork โ 0 โ errored โ 15 โ 0 โ 0% โ 0 B โ user โ disabled โ
โ APPNAME โ 3 โ fork โ 5406 โ stopped โ 1 โ 0 โ 0% โ 0 B โ user โ disabled โ
โโโโโโโโโโโโโโโโโโโดโโโโโดโโโโโโโดโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโ
$ pm2 stop APPNAME
[PM2] Applying action stopProcessId on app APPNAME
[PM2] [APPNAME](3) โ
$ pm2 start APPNAME
[PM2] Applying action restartProcessId on app APPNAME
[PM2][ERROR] Process 3 not found
pm2 update
Be sure to have the latest version by doing npm install pm2@latest -g before doing this procedure.
[PM2] Saving current process list...
[PM2] Stopping PM2...
[PM2] Applying action deleteProcessId on app all
[PM2] [all](0) โ
(hangs)
(ctrl+c)
pm2 update
Be sure to have the latest version by doing npm install pm2@latest -g before doing this procedure.
[PM2] Saving current process list...
[PM2] Stopping PM2...
[PM2] Applying action deleteProcessId on app all
[PM2] [APPNAME](3) โ
[PM2] [APP](2) โ
[PM2] [APP](1) โ
[PM2] [APP](4) โ
[PM2] All processes have been stopped and deleted
[PM2] PM2 stopped
[PM2] Spawning PM2 daemon with pm2_home=/home/user/.pm2
[PM2] Restoring processes located in /home/user/.pm2/dump.pm2
[PM2] Process APP restored
[PM2] Process APP restored
[PM2] Process APPNAME restored
[PM2] Process APP restored
PM2 updated
I am having the same issue on version 3.1.3.
I'm having this issue too
I'm having this issue too
Most helpful comment
I've had this occur on a recent version of pm2. The app that crashed is #3, and has been renamed to APPNAME for privacy reasons. Unrelated applications renamed to APP. As you can see, I had to run pm2 update, and then kill it after it hung, before running it again.
If this occurs again, is there anything I can do to log with additional verbosity when running pm2 update? Might be able to determine what causes it to hang, and perhaps that would aid in root cause analysis.
pm2 -v2.10.1$ pm2 start APPNAME[PM2] Applying action restartProcessId on app APPNAME
[PM2][ERROR] Process 3 not found
โโโโโโโโโโโโโโโโโโโฌโโโโโฌโโโโโโโฌโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ mode โ pid โ status โ restart โ uptime โ cpu โ mem โ user โ watching โ
โโโโโโโโโโโโโโโโโโโผโโโโโผโโโโโโโผโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโผโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโค
โ APP โ 1 โ fork โ 14625 โ online โ 1 โ 11D โ 0% โ 52.1 MB โ user โ disabled โ
โ APP โ 2 โ fork โ 1819 โ online โ 436 โ 39h โ 0% โ 127.4 MB โ user โ disabled โ
โ APP โ 4 โ fork โ 5412 โ online โ 0 โ 20D โ 0% โ 44.4 MB โ user โ disabled โ
โ APP โ 0 โ fork โ 0 โ errored โ 15 โ 0 โ 0% โ 0 B โ user โ disabled โ
โ APPNAME โ 3 โ fork โ 5406 โ stopped โ 1 โ 0 โ 0% โ 0 B โ user โ disabled โ
โโโโโโโโโโโโโโโโโโโดโโโโโดโโโโโโโดโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโ
$ pm2 stop APPNAME[PM2] Applying action stopProcessId on app APPNAME
[PM2] [APPNAME](3) โ
$ pm2 start APPNAME[PM2] Applying action restartProcessId on app APPNAME
[PM2][ERROR] Process 3 not found
pm2 updateBe sure to have the latest version by doing
npm install pm2@latest -gbefore doing this procedure.[PM2] Saving current process list...
[PM2] Stopping PM2...
[PM2] Applying action deleteProcessId on app all
[PM2] [all](0) โ
(hangs)(ctrl+c)pm2 updateBe sure to have the latest version by doing
npm install pm2@latest -gbefore doing this procedure.[PM2] Saving current process list...
[PM2] Stopping PM2...
[PM2] Applying action deleteProcessId on app all
[PM2] [APPNAME](3) โ
[PM2] [APP](2) โ
[PM2] [APP](1) โ
[PM2] [APP](4) โ
[PM2] All processes have been stopped and deleted
[PM2] PM2 stopped
[PM2] Spawning PM2 daemon with pm2_home=/home/user/.pm2
[PM2] Restoring processes located in /home/user/.pm2/dump.pm2
[PM2] Process APP restored
[PM2] Process APP restored
[PM2] Process APPNAME restored
[PM2] Process APP restored