Open ebors opened 6 years ago
same here, every one minute i see on pm2 monit
the message
pm2-server-monit > Failed to retrieve process count null
other logs..
other logs..
pm2-server-monit > Failed to retrieve process count null
@carlosen14 I am facing the exact issue. any solution for it
nope, just let it go... :(
Hi, I'm having similar issue still...is it still outstanding issue and not fixed yet? Here is my log:
pm2-server-monit > Failed to retrieve TTY metrics { Error: Command failed: who | grep -v localhost | wc -l
Any updates with it?
Similar issue on September 2020 !
Problem happens here, my problem was that my Docker container was using a Debian without the top process. I just installed the 'procps' package using apt and things are fine now.
Any updates on this? It is quite annoying.
Issue exists 5 years and reproducible on your official docker image(18-alpine)
Same here in Q4 2023
0|pm2-server-monit | Failed to retrieve number of file descriptor [Error: ENOENT: no such file or directory, open 'C:\proc\sys\fs\file-nr'] {
0|pm2-server-monit | errno: -4058,
0|pm2-server-monit | code: 'ENOENT',
0|pm2-server-monit | syscall: 'open',
0|pm2-server-monit | path: 'C:\\proc\\sys\\fs\\file-nr'
0|pm2-server-monit | }
0|pm2-server-monit | Failed to retrieve zombie process count Error: Command failed: top -bn1 | awk 'NR > 7 && $8 ~ /Z/ { print $12 }'
0|pm2-server-monit | 'top' is not recognized as an internal or external command,
0|pm2-server-monit | operable program or batch file.
0|pm2-server-monit | at ChildProcess.exithandler (node:child_process:422:12)
0|pm2-server-monit | at ChildProcess.emit (node:events:514:28)
0|pm2-server-monit | at maybeClose (node:internal/child_process:1105:16)
0|pm2-server-monit | at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
0|pm2-server-monit | code: 255,
0|pm2-server-monit | killed: false,
0|pm2-server-monit | signal: null,
0|pm2-server-monit | cmd: "top -bn1 | awk 'NR > 7 && $8 ~ /Z/ { print $12 }'"
0|pm2-server-monit | }
0|pm2-server-monit | Failed to retrieve process count Error: Command failed: top -bn1 | awk 'NR > 7 && $8 ~ /R|S|D|T/ { print $12 }'
0|pm2-server-monit | 'top' is not recognized as an internal or external command,
0|pm2-server-monit | operable program or batch file.
0|pm2-server-monit | at ChildProcess.exithandler (node:child_process:422:12)
0|pm2-server-monit | at ChildProcess.emit (node:events:514:28)
0|pm2-server-monit | at maybeClose (node:internal/child_process:1105:16)
0|pm2-server-monit | at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
0|pm2-server-monit | code: 255,
0|pm2-server-monit | killed: false,
0|pm2-server-monit | signal: null,
0|pm2-server-monit | cmd: "top -bn1 | awk 'NR > 7 && $8 ~ /R|S|D|T/ { print $12 }'"
0|pm2-server-monit | }
0|pm2-server-monit | Failed to retrieve number of file descriptor [Error: ENOENT: no such file or directory, open 'C:\proc\sys\fs\file-nr'] {
0|pm2-server-monit | errno: -4058,
0|pm2-server-monit | code: 'ENOENT',
0|pm2-server-monit | syscall: 'open',
0|pm2-server-monit | path: 'C:\\proc\\sys\\fs\\file-nr'
0|pm2-server-monit | }
0|pm2-server-monit | Failed to retrieve process count Error: Command failed: top -bn1 | awk 'NR > 7 && $8 ~ /R|S|D|T/ { print $12 }'
0|pm2-server-monit | 'top' is not recognized as an internal or external command,
0|pm2-server-monit | operable program or batch file.
0|pm2-server-monit | at ChildProcess.exithandler (node:child_process:422:12)
0|pm2-server-monit | at ChildProcess.emit (node:events:514:28)
0|pm2-server-monit | at maybeClose (node:internal/child_process:1105:16)
0|pm2-server-monit | at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
0|pm2-server-monit | code: 255,
0|pm2-server-monit | killed: false,
0|pm2-server-monit | signal: null,
0|pm2-server-monit | cmd: "top -bn1 | awk 'NR > 7 && $8 ~ /R|S|D|T/ { print $12 }'"
0|pm2-server-monit | }
0|pm2-server-monit | Failed to retrieve zombie process count Error: Command failed: top -bn1 | awk 'NR > 7 && $8 ~ /Z/ { print $12 }'
0|pm2-server-monit | 'top' is not recognized as an internal or external command,
0|pm2-server-monit | operable program or batch file.
0|pm2-server-monit | at ChildProcess.exithandler (node:child_process:422:12)
0|pm2-server-monit | at ChildProcess.emit (node:events:514:28)
0|pm2-server-monit | at maybeClose (node:internal/child_process:1105:16)
0|pm2-server-monit | at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
0|pm2-server-monit | code: 255,
0|pm2-server-monit | killed: false,
0|pm2-server-monit | signal: null,
0|pm2-server-monit | cmd: "top -bn1 | awk 'NR > 7 && $8 ~ /Z/ { print $12 }'"
0|pm2-server-monit | }
0|pm2-server-monit | Failed to retrieve number of file descriptor [Error: ENOENT: no such file or directory, open 'C:\proc\sys\fs\file-nr'] {
0|pm2-server-monit | errno: -4058,
0|pm2-server-monit | code: 'ENOENT',
0|pm2-server-monit | syscall: 'open',
0|pm2-server-monit | path: 'C:\\proc\\sys\\fs\\file-nr'
0|pm2-server-monit | }
0|pm2-server-monit | Failed to retrieve process count Error: Command failed: top -bn1 | awk 'NR > 7 && $8 ~ /R|S|D|T/ { print $12 }'
0|pm2-server-monit | 'top' is not recognized as an internal or external command,
0|pm2-server-monit | operable program or batch file.
0|pm2-server-monit | at ChildProcess.exithandler (node:child_process:422:12)
0|pm2-server-monit | at ChildProcess.emit (node:events:514:28)
0|pm2-server-monit | at maybeClose (node:internal/child_process:1105:16)
0|pm2-server-monit | at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
0|pm2-server-monit | code: 255,
0|pm2-server-monit | killed: false,
0|pm2-server-monit | signal: null,
0|pm2-server-monit | cmd: "top -bn1 | awk 'NR > 7 && $8 ~ /R|S|D|T/ { print $12 }'"
0|pm2-server-monit | }
0|pm2-server-monit | Failed to retrieve zombie process count Error: Command failed: top -bn1 | awk 'NR > 7 && $8 ~ /Z/ { print $12 }'
0|pm2-server-monit | 'top' is not recognized as an internal or external command,
0|pm2-server-monit | operable program or batch file.
0|pm2-server-monit | at ChildProcess.exithandler (node:child_process:422:12)
0|pm2-server-monit | at ChildProcess.emit (node:events:514:28)
0|pm2-server-monit | at maybeClose (node:internal/child_process:1105:16)
0|pm2-server-monit | at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
0|pm2-server-monit | code: 255,
0|pm2-server-monit | killed: false,
0|pm2-server-monit | signal: null,
0|pm2-server-monit | cmd: "top -bn1 | awk 'NR > 7 && $8 ~ /Z/ { print $12 }'"
0|pm2-server-monit | }
Issue still exists, I console log alot of stuff and this error is clogging up my logs which is real annoying. Might just uninstall server-monit since I can just RDP into my server in like 5 seconds and check task manager. Thanks PM2 for ignoring an issue since 2018!
So, in case someone wants to get rid of those errors:
Go to C:\Users\YOURUSER\.pm2\modules\pm2-server-monit\node_modules\pm2-server-monit\src\metrics
and check every file in there for fetch()
functions (those do the unix commands through an exec
). Then just delete their contents or comment them.
For example in tty.js
change:
fetch () {
exec('who | grep -v localhost | wc -l', (err, stdout, stderr) => {
if (err || stdout.length === 0) return console.error(`Failed to retrieve TTY metrics`, err)
this.ttyCount.set(parseInt(stdout))
})
}
to:
fetch () {
}
Far from a clean solution, but the errors will be gone and I don't miss any feature.
Running pm2 on windows causes many errors. The pm2 process want to call unix commands like top, who, grep etc. :