Skip to content
This repository was archived by the owner on Jun 24, 2026. It is now read-only.
This repository was archived by the owner on Jun 24, 2026. It is now read-only.

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

Open

Description

@arkadini

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.

Activity

  1. abl commented on Feb 18, 2017

    @abl

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

  2. carlos-jenkins commented on Feb 7, 2018

    @carlos-jenkins

    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.

  3. curiousleo commented on Mar 1, 2018

    @curiousleo

    Same problem here.

  4. vladsavchuk commented on May 16, 2018

    @vladsavchuk

    Same here. Tons of warnings with docker containers.

  5. willvincent commented on Jul 19, 2018

    @willvincent

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

  6. jamezpolley commented on Oct 27, 2018

    @jamezpolley

    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.

  7. willvincent commented on Oct 27, 2018

    @willvincent

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

  8. jamezpolley commented on Oct 27, 2018

    @jamezpolley

    Thanks @willvincent

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

  9. perry commented on Apr 5, 2020

    @perry

    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
    
  10. alexfornuto commented on Feb 1, 2025

    @alexfornuto
    Contributor

    I was working at Linode when Longview was released. It's a shame to see it stagnate like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions