Command Prompts
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
Hey,
I use Windows 10, with my bot Xyborg. Recently, my bot was shutting down after about 5 minutes due to inactivity. So, I installed pm2. I navigated from my Xyborg folder to my src\Handlers\Basic. Here, I did pm2 start index.js. Here starts the problem. It started spawning like hundreds of Command Prompts, and I could not do anything. Somehow, I managed to run pm2 stop index.js and stopped the process. Is there any way I can fix this?
Also, when I tried to make the GIF, this did not occur. It happens randomly.
How could we reproduce this issue?
To reproduce the issue, run pm2 start index.js on Windows 10
Supporting information
I will attach a short GIF of how it happens. I will also file a report using pm2 report. I cannot make the GIF because this Bug is happening randomly.
Report Data
--- PM2 report ----------------------------------------------------------------
Date : Wed Feb 03 2021 16:30:43 GMT+0530 (India Standard Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 4.5.4
node version : 15.7.0
node path : not found
argv : C:\Program Files\nodejs\node.exe,C:\Users\chira\AppData\Roaming\npm\node_modules\pm2\lib\Daemon.js
argv0 : node
user : undefined
uid : N/A
gid : N/A
uptime : 11min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 4.5.4
node version : 15.7.0
node path : not found
argv : C:\Program Files\nodejs\node.exe,C:\Users\chira\AppData\Roaming\npm\node_modules\pm2\bin\pm2,report
argv0 : node
user : chira
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : win32
type : Windows_NT
cpus : Intel(R) Core(TM) i3-7020U CPU @ 2.30GHz
cpus nb : 4
freemem : 1912094720
totalmem : 8466419712
home : C:\Users\chira
===============================================================================
--- PM2 list -----------------------------------------------
┌─────┬──────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼──────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ index │ default │ 1.0.0 │ fork │ 11392 │ 0s │ 84 │ online │ 0% │ 0b │ chira │ disabled │
└─────┴──────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
C:\Users\chira\.pm2\pm2.log last 20 lines:
PM2 | 2021-02-03T16:30:34: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2 | 2021-02-03T16:30:34: PM2 log: App [index:0] starting in -fork mode-
PM2 | 2021-02-03T16:30:34: PM2 log: App [index:0] online
PM2 | 2021-02-03T16:30:36: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2 | 2021-02-03T16:30:36: PM2 log: App [index:0] starting in -fork mode-
PM2 | 2021-02-03T16:30:36: PM2 log: App [index:0] online
PM2 | 2021-02-03T16:30:38: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2 | 2021-02-03T16:30:38: PM2 log: App [index:0] starting in -fork mode-
PM2 | 2021-02-03T16:30:38: PM2 log: App [index:0] online
PM2 | 2021-02-03T16:30:39: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2 | 2021-02-03T16:30:39: PM2 log: App [index:0] starting in -fork mode-
PM2 | 2021-02-03T16:30:39: PM2 log: App [index:0] online
PM2 | 2021-02-03T16:30:41: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2 | 2021-02-03T16:30:41: PM2 log: App [index:0] starting in -fork mode-
PM2 | 2021-02-03T16:30:41: PM2 log: App [index:0] online
PM2 | 2021-02-03T16:30:43: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2 | 2021-02-03T16:30:43: PM2 log: App [index:0] starting in -fork mode-
PM2 | 2021-02-03T16:30:43: PM2 log: App [index:0] online
PM2 | 2021-02-03T16:30:43: PM2 error: Error caught while calling pidusage
PM2 | 2021-02-03T16:30:43: PM2 error: Error: Error: spawn wmic ENOENT
EDIT:- When I run pm2 logs, there is spam saying that Error while calling pidusage
I run it by pm2 start . and if there are any problems, tell me. I have not modified any files to adjust with PM2's metrics or any other part of the packages. I just run pm2 start . to do that as mentioned above. Below is the exact error
PM2 | Error caught while calling pidusage
PM2 | Error: Error: spawn wmic ENOENT
PM2 | at ChildProcess.<anonymous> (C:\Users\chira\AppData\Roaming\npm\node_modules\pm2\node_modules\pidusage\lib\bin.js:33:10)
PM2 | at ChildProcess.emit (node:events:379:20)
PM2 | at ChildProcess.EventEmitter.emit (node:domain:470:12)
PM2 | at Process.ChildProcess._handle.onexit (node:internal/child_process:287:12)
PM2 | at onErrorNT (node:internal/child_process:481:16)
PM2 | at processTicksAndRejections (node:internal/process/task_queues:81:21)
Thanks!!
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 pm2/node_modules/pidusage/lib/bin.js at the reported error and review the PM2 daemon logs showing repeated restarts and spawn wmic ENOENT. Reproduce on Windows 10 with pm2 start index.js; done means the process no longer spawns repeated Command Prompts or repeatedly reports pidusage errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100