Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silently returns incorrect results sporadically (Ubuntu) #79

Open
logidelic opened this issue Feb 26, 2019 · 4 comments
Open

Silently returns incorrect results sporadically (Ubuntu) #79

logidelic opened this issue Feb 26, 2019 · 4 comments

Comments

@logidelic
Copy link

logidelic commented Feb 26, 2019

I have been using ps-node in production for about a year. I have experienced some mystery issues very rarely but never investigated closely enough until today. Finally I realize that, rarely, ps-node is failing to parse the process list correctly and is therefor returning incorrect results.

I know that there is a note about "limitations" for multiple-bytes characters. Is it possible that there was some other process in the system that was using a multi-byte character? Sure, how would I know? The point is that users can't know this, so the "limitation" should be rephrased as, "ps-node is unreliable and sometimes it returns incorrect information". I think this needs to be put up front, at the very top of the readme.

To summarize: ps-node is not to be used anywhere that reliability is important.

I still appreciate the work done by the module writers... I understand that parsing the command-line output is problematic and maybe even impossible in this case. I just think that users should understand this...

For what it's worth, below is an exerpt of what ps-node returned to me in the problem case. I haven't been able to repro since then so I don't know what tickled it. Note that instead of the actual command, some incorreclty-parsed digits are returned:

[
    {
        "pid": "1314",
        "command": "0:00",
        "arguments": [
            "/lib/systemd/systemd-logind"
        ],
        "ppid": "1"
    },
    {
        "pid": "1324",
        "command": "0:20",
        "arguments": [
            "/usr/lib/snapd/snapd"
        ],
        "ppid": "1"
    },
    {
        "pid": "1346",
        "command": "0:00",
        "arguments": [
            "/usr/sbin/sshd",
            "-D"
        ],
        "ppid": "1"
    },
    {
        "pid": "1441",
        "command": "0:00",
        "arguments": [
            "/sbin/agetty",
            "--keep-baud",
            "115200",
            "38400",
            "9600",
            "ttyS0",
            "vt220"
        ],
        "ppid": "1"
    },
    {
        "pid": "1444",
        "command": "0:00",
        "arguments": [
            "/sbin/agetty",
            "--noclear",
            "tty1",
            "linux"
        ],
        "ppid": "1"
    }
]
@dustingraham
Copy link

I found this happens when the table does not line up. Try ps lx and you may see the PID and PPID columns are not correct.

I found adding { psargs: '-ef' } was a more reliable output on Centos 7 at least.

@bbreukelen
Copy link

I ran into the same issue. I use ps-node to check if a process is still running and if not restart it. Every now and then it returns an empty array without an error. At the end of a day, about 15 processes are running. I didn't find a workaround yet.

@kethinov
Copy link

kethinov commented Apr 6, 2020

I have seen this happen on macOS too.

@dougnorton
Copy link

I've seen it on macOS too. I captured some output that causes the table parser to fail:

You can see there are some misaligned columns causing the TIME and COMMAND fields to have the same titleBegin.

  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT   TT       TIME COMMAND
  501 52471   889   0  20  0  2880288  34228 -      S      ??    0:00.15 /Applications/Utilities/Adobe Creative Cloud/ACC/Creative Cloud.app/Contents/MacOS/../Frameworks/Adobe CEF Helper (Renderer).app/Contents/MacOS/Adobe CEF Helper (Renderer) --type=renderer --no-sandbox --log-file=/Users/doug/Library/Logs/CreativeCloud/ACC/CEF.log --field-trial-handle=1718379636,8639217701376796837,5451438729807851544,131072 --disable-features=AsyncWheelEvents,TouchpadAndWheelScrollLatching --lang=en-US --log-file=/Users/doug/Library/Logs/CreativeCloud/ACC/CEF.log --log-severity=warning --user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36 CreativeCloud/5.1.0.407 --num-raster-threads=2 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --service-request-channel-token=1850071163697013316 --renderer-client-id=86 --no-v8-untrusted-code-mitigations
  501 53067     1   0  61  0 106163472 1100632 -      Ss     ??    6:42.50 /System/Library/StagedFrameworks/Safari/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent

hardillb added a commit to FlowFuse/driver-localfs that referenced this issue Mar 8, 2022
ps-node has an issue (neekey/ps#79) and
appears to have been abandoned

This checks that the project id returned from /flowforge/info endpoint
is consitent with the expect id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants