Unitech / Unitech/pm2

Error caught while calling pidusage | PROCESS - Alias not found.

Open
#5,824 2 comments 0 reactions 0 assignees View on GitHub

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?

Everytime i start my app i keep getting these messages on pm2

PM2      | Error caught while calling pidusage
PM2      | Error: PROCESS - Alias not found.
PM2      |     at ChildProcess.<anonymous> (C:\Users\pipel\AppData\Roaming\nvm\v16.16.0\node_modules\pm2\node_modules\pidusage\lib\bin.js:41:19)
PM2      |     at ChildProcess.emit (node:events:527:28)
PM2      |     at ChildProcess.emit (node:domain:537:15)
PM2      |     at maybeClose (node:internal/child_process:1092:16)
PM2      |     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
PM2      |     at Process.callbackTrampoline (node:internal/async_hooks:130:17)

then if i run pm2 list i get this (I will replace my app name with "APP_NAME" cus its the domain name of the app)

C:\Users\pipel>pm2 list
⇆ PM2+ activated | Instance Name: (i don't know if i should display this) | Dash: https://app.pm2.io/#/r/(i don't know if i should display this)
┌────┬───────────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name                  │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼───────────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0  │ APP_NAME    │ default     │ 0.0.0   │ fork    │ 25400    │ 0      │ 0    │ errored   │ 0%       │ 0b       │ pipel    │ enabled  │
└────┴───────────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
[PM2][WARN] Current process list is not synchronized with saved list. App bot differs. Type 'pm2 save' to synchronize.

then if I try to restart the app I get this

C:\Users\pipel>pm2 restart 0
Use --update-env to update environment variables
[PM2] Applying action restartProcessId on app [0](ids: [ '0' ])
[PM2][ERROR] Process 0 not found

and on the pm2 logs it shows

PM2      | Process with pid 25400 already exists

if i try to delete the process i get this

C:\Users\pipel>pm2 delete 0
[PM2] Applying action deleteProcessId on app [0](ids: [ '0' ])
[PM2] [APP_NAME](0) ✓
⇆ PM2+ activated | Instance Name: | Dash: 
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
[PM2][WARN] Current process list is not synchronized with saved list. App api.ghostboard.net bot differs. Type 'pm2 save' to synchronize.

and on the pm2 logs it shows

PM2      | Stopping app:api.ghostboard.net id:0
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | Process with pid 25400 still alive after 1600ms, sending it SIGKILL now...
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | pid=25400 msg=failed to kill - retrying in 100ms
PM2      | Process with pid 25400 could not be killed
PM2      | app=api.ghostboard.net id=0 pid=25400 could not be stopped
PM2      | AXM MONITOR Unknown id 0
PM2      | AXM MONITOR Unknown id 0
PM2      | AXM MONITOR Unknown id 0
PM2      | AXM MONITOR Unknown id 0

How could we reproduce this issue?

I dont really know

Supporting information

--- PM2 report ----------------------------------------------------------------
Date                 : Thu May 23 2024 05:34:06 GMT-0500 (Central Daylight Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.3.1
node version         : 16.16.0
node path            : not found
argv                 : C:\Program Files\nodejs\node.exe,C:\Users\pipel\AppData\Roaming\nvm\v16.16.0\node_modules\pm2\lib\Daemon.js
argv0                : node
user                 : undefined
uid                  : N/A
gid                  : N/A
uptime               : 9min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.3.1
node version         : 16.16.0
node path            : not found
argv                 : C:\Program Files\nodejs\node.exe,C:\Program Files\nodejs\node_modules\pm2\bin\pm2,report
argv0                : C:\Program Files\nodejs\\node.exe
user                 : pipel
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : win32
type                 : Windows_NT
cpus                 : AMD Ryzen 9 5900X 12-Core Processor
cpus nb              : 24
freemem              : 20449284096
totalmem             : 34278064128
home                 : C:\Users\pipel
===============================================================================
--- PM2 list -----------------------------------------------
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
[PM2][WARN] Current process list is not synchronized with saved list. App api.ghostboard.net bot differs. Type 'pm2 save' to synchronize.
===============================================================================
--- Daemon logs --------------------------------------------
C:\Users\pipel\.pm2\pm2.log last 20 lines:
PM2        | 2024-05-23T05:33:46: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:47: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:48: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:49: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:50: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:51: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:52: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:53: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:54: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:55: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:56: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:57: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:58: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:33:59: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:34:00: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:34:01: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:34:02: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:34:03: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:34:04: PM2 error: AXM MONITOR Unknown id 0
PM2        | 2024-05-23T05:34:05: PM2 error: AXM MONITOR Unknown id 0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows setup with PM2 5.3.1 and Node 16.16.0, using the reported pm2 commands and logs. Inspect node_modules/pidusage/lib/bin.js around the reported error and the PM2 daemon logs for the process-tracking path. Done means the pidusage alias error and related inability to restart or kill the process no longer occur.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.