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

KeyError: 'getpwuid(): uid not found: 999' #547

Closed
LouisKottmann opened this issue Nov 5, 2014 · 3 comments
Closed

KeyError: 'getpwuid(): uid not found: 999' #547

LouisKottmann opened this issue Nov 5, 2014 · 3 comments

Comments

@LouisKottmann
Copy link

Hello,

Hello,

I'm trying to get psdash running (it uses psutil), but when checking processes psutils produces the error mentionned in the title, please see the full error log: Jahaja/psdash#36

I tested with psutil 2.1.1 and 2.1.3 as psdash requirement in their setup.py

I checked (with ps -le | grep 999), uid 999 is related to postgres/murmurd/mongodb on my system, and doesn't seem to have an associated user:

cat /etc/passwd | cut -d':' -f1 | xargs -I {} id {}

shows no user with uid 999

Apparently, psutil can't handle such case. Any ideas?

@giampaolo
Copy link
Owner

Sorry, this totally slipped under my radar. KeyError: 'getpwuid(): uid not found: 999' originates from the pwd module which is not able to resolve UID 999. I'm not sure what's best to do here. We could catch the exception and return 999 but letting the exception propagate also looks kinda correct to me. Not sure...

@LouisKottmann
Copy link
Author

The issue was fixed in Jahaja/psdash#36, I think this can be closed.

giampaolo added a commit that referenced this issue Nov 26, 2014
… be resolved by the system (as opposed to letting KeyError propagate)
@giampaolo
Copy link
Owner

After some thought I think this should be handled by psutil, mainly because if we use Process.as_dict() instead of Process.username() directly the whole operation will fail. Fixed in 4dfb4ad.

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