longview icon indicating copy to clipboard operation
longview copied to clipboard

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

Open arkadini opened this issue 8 years ago • 9 comments

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 https://github.com/linode/longview/blob/240db8f231081270d6a478809dc73574b59a2918/Linode/Longview/DataGetter/Processes.pm#L68 seems to assume otherwise:

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

$proc{user} is later used in https://github.com/linode/longview/blob/240db8f231081270d6a478809dc73574b59a2918/Linode/Longview/DataGetter/Processes.pm#L101-L108 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.

arkadini avatar Apr 21 '16 10:04 arkadini

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

abl avatar Feb 18 '17 23:02 abl

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.

carlos-jenkins avatar Feb 07 '18 01:02 carlos-jenkins

Same problem here.

curiousleo avatar Mar 01 '18 20:03 curiousleo

Same here. Tons of warnings with docker containers.

vladsavchuk avatar May 16 '18 13:05 vladsavchuk

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

willvincent avatar Jul 19 '18 04:07 willvincent

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.

jamezpolley avatar Oct 27 '18 02:10 jamezpolley

@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.

willvincent avatar Oct 27 '18 02:10 willvincent

Thanks @willvincent

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

jamezpolley avatar Oct 27 '18 02:10 jamezpolley

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

perry avatar Apr 05 '20 14:04 perry