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

api/v2.0/ps/ Error with <defunct> processes #2814

Closed
Not-Code opened this issue Feb 27, 2021 · 2 comments
Closed

api/v2.0/ps/ Error with <defunct> processes #2814

Not-Code opened this issue Feb 27, 2021 · 2 comments

Comments

@Not-Code
Copy link

Whenever the GetProcessList calls ps -e -o user,pid,ppid,stime,pcpu,pmem,rss,vsz,stat,time,comm,psr,cgroup and a defunct process is present in the returned list, the API fails and the client gets a 500 error with the following output:

process listing failed: invalid pid "24647": strconv.Atoi: parsing "<defunct>": invalid syntax

Below an example of the output that is breaking the parsing:

root 24647 10145 17:24 0.0 0.0 0 0 Z<s 00:00:00 SYNO. <defunct> 3 -

@Not-Code
Copy link
Author

This is caused by the following line of code in container.go

psr, err := strconv.Atoi(fields[11])
if err != nil {
	return nil, fmt.Errorf("invalid pid %q: %v", fields[1], err)
}

and that part has been deleted in master:

#2751

Closing the issue and waiting for the release.

@iwankgb
Copy link
Collaborator

iwankgb commented Mar 1, 2021

@Not-Code I will try to have the fix backported to 0.37 and 0.38.

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

2 participants