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

data getter for processes shouldn't assume that every uid has pwd entry #24

Open
arkadini opened this issue Apr 21, 2016 · 9 comments · May be fixed by #42
Open

data getter for processes shouldn't assume that every uid has pwd entry #24

arkadini opened this issue Apr 21, 2016 · 9 comments · May be fixed by #42

Comments

@arkadini
Copy link

Processes can run (e.g. inside docker containers) with user ids that don't have valid pwd entries on the host system. The code at

$proc{user} = ( getpwuid( $proc{uid} ) )[0];
seems to assume otherwise:

$proc{user} = ( getpwuid( $proc{uid} ) )[0];

$proc{user} is later used in

$dataref->{LONGTERM}->{"Processes.${info{name}}.${info{user}}.count"}++;
$dataref->{LONGTERM}->{"Processes.${info{name}}.${info{user}}.mem"} += $info{mem} + 0;
$dataref->{LONGTERM}->{"Processes.${info{name}}.${info{user}}.cpu"} += $info{cpu} if (defined $info{cpu});
$dataref->{LONGTERM}->{"Processes.${info{name}}.${info{user}}.ioreadkbytes"} += $info{ioreadkbytes} if (defined $info{ioreadkbytes});
$dataref->{LONGTERM}->{"Processes.${info{name}}.${info{user}}.iowritekbytes"} += $info{iowritekbytes} if (defined $info{iowritekbytes});
$dataref->{LONGTERM}->{"Processes.${info{name}}.${info{user}}.zz_age"} = $info{age}
if ((!defined($dataref->{LONGTERM}->{"Processes.${info{name}}.${info{user}}.zz_age"} )) ||
$info{age} > $dataref->{LONGTERM}->{"Processes.${info{name}}.${info{user}}.zz_age"} );
and results in hundreds of warning in the log file, repeated every 5 minutes:

04/21 09:51:35 WARN Longview[6907] - Use of uninitialized value $info{"user"} in concatenation (.) or string at /opt/linode/longview/Linode/Longview/DataGetter/Processes.pm line 101.
@abl
Copy link

abl commented Feb 18, 2017

I'm seeing this as well. Debating what to replace it with.

@carlos-jenkins
Copy link

carlos-jenkins commented Feb 7, 2018

Oh my! 10 minutes with longview running:

$ cat /var/log/linode/longview.log | grep "Use of uninitialized value" | wc -l
10502

This is crazy!

And yes I have many containers running.

@curiousleo
Copy link

Same problem here.

@vladsavchuk
Copy link

vladsavchuk commented May 16, 2018

Same here. Tons of warnings with docker containers.

@willvincent willvincent linked a pull request Jul 19, 2018 that will close this issue
@willvincent
Copy link

As it turns out, the fix is actually really simple.

@jamezpolley
Copy link

I've spent the last 3 months raising ticket after ticket with linode support about this, and they keep suggesting random things like "try uninstalling and then reinstalling the agent" and seem completely unaware of this issue that has been open for years.

@willvincent
Copy link

@jamezpolley I've actually contacted them directly suggesting they pay attention to this repo as there are several outstanding pull requests. They didn't seem too interested at all. Kind of sad really.

If you clone my fork, and use it instead you won't have to deal with this issue anymore.

@jamezpolley
Copy link

Thanks @willvincent

Since applying this change, data in the longview console is updating pretty much live for the first time ever.

@perry
Copy link

perry commented Apr 5, 2020

Investigating high disk usage on a box that's been running for a few years. 17GB of this error message. Ugh.

******@******:~$ ls -la /var/log/linode/
total 16521152
drwxr-xr-x  2 root root          4096 Oct 26  2016 .
drwxrwxr-x 13 root syslog        4096 Apr  5 06:25 ..
-rw-r--r--  1 root root   16917621837 Apr  5 21:20 longview.log

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

Successfully merging a pull request may close this issue.

8 participants