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

tracer invocation fails with uid not found: 93 #33

Closed
michel-slm opened this issue Jan 29, 2015 · 22 comments
Closed

tracer invocation fails with uid not found: 93 #33

michel-slm opened this issue Jan 29, 2015 · 22 comments
Labels

Comments

@michel-slm
Copy link

I get the same traceback from Tracer when its invoked from the command line as well as using the DNF plugin:

$ rpm -q tracer dnf-plugin-tracer
tracer-0.5.6-1.fc21.noarch
dnf-plugin-tracer-0.5.6-1.fc21.noarch

$ sudo tracer
[sudo] password for michel: 
Traceback (most recent call last):
  File "/bin/tracer", line 34, in <module>
    tracer.main.run()
  File "/usr/lib/python2.7/site-packages/tracer/main.py", line 42, in run
    return router.dispatch()
  File "/usr/lib/python2.7/site-packages/tracer/resources/router.py", line 54, in dispatch
    controller = DefaultController(self.args, self.packages)
  File "/usr/lib/python2.7/site-packages/tracer/controllers/default.py", line 45, in __init__
    self.applications = self.tracer.trace_affected(self._user(args.user))
  File "/usr/lib/python2.7/site-packages/tracer/resources/tracer.py", line 73, in trace_affected
    memory = Memory.dump_memory(user)
  File "/usr/lib/python2.7/site-packages/tracer/resources/memory.py", line 36, in dump_memory
    for process in Processes.all().owned_by(user).unique():
  File "/usr/lib/python2.7/site-packages/tracer/resources/collections.py", line 65, in owned_by
    return self.filtered(lambda process: process.username == user)
  File "/usr/lib/python2.7/site-packages/tracer/resources/collections.py", line 81, in filtered
    if function(process):
  File "/usr/lib/python2.7/site-packages/tracer/resources/collections.py", line 65, in <lambda>
    return self.filtered(lambda process: process.username == user)
  File "/usr/lib64/python2.7/site-packages/psutil/__init__.py", line 441, in username
    return pwd.getpwuid(self.uids.real).pw_name
KeyError: 'getpwuid(): uid not found: 93'
@FrostyX
Copy link
Owner

FrostyX commented Jan 29, 2015

Hello Michel,
thank you for the report.

Please, what version of python-psutil do you have?

@michel-slm
Copy link
Author

python-psutil-1.2.1-5.fc21.x86_64 ... could I possibly need the new 2.1.x release that's in F22?

@FrostyX
Copy link
Owner

FrostyX commented Jan 29, 2015

Current git version of tracer needs 2.1.x, but the version you have installed requires 1.2.x.

The traceback comes from strange place. For assurance, please what output you get from command

 python -c "import psutil; p=psutil.Process(6024); print p.username"

(replace 6024 with pid of some of your process)

@FrostyX
Copy link
Owner

FrostyX commented Jan 29, 2015

Also id -u michel could be interesting.

@xsuchy
Copy link
Contributor

xsuchy commented Jan 29, 2015

If I am reading the code correctly then self.uids is the owner of the process. Therefore if you start process under user foo, then you uninstall the package and remove user foo (bad practice, but some people do that). psutil have that id, but pwd is unable to match with getent database.

@FrostyX
Copy link
Owner

FrostyX commented Jan 30, 2015

Thank you @xsuchy. Good point.

@michel-slm
Copy link
Author

$∙python -c "import psutil; p=psutil.Process(22241); print p.username"
michel
$∙id -u michel                                         1:30  michel@michel-dell
1000

Plus, isn't 93 a system uid, not one that normal users would get?

@xsuchy
Copy link
Contributor

xsuchy commented Jan 30, 2015

AFAIK 93 is reserved for exim.

@michel-slm
Copy link
Author

$ rpm -q exim
package exim is not installed

$  grep :93: /etc/passwd; echo $?
1

Odd...

@FrostyX
Copy link
Owner

FrostyX commented Feb 1, 2015

This issue is simply reproducable as @xsuchy said. Thank you.

sudo useradd tmpuser
sudo passwd tmpuser
su - tmpuser -c 'nano'

# In another terminal
sudo userdel tmpuser --force
sudo tracer.py --show-resource=processes

I will fix it soon.

@FrostyX
Copy link
Owner

FrostyX commented Feb 1, 2015

@michel-slm, can you please try it now, but from git?

git clone https://github.com/FrostyX/tracer.git
cd tracer
git checkout psutil-1.x.x
sudo bin/tracer.py

@michel-slm
Copy link
Author

Will try tonight on the affected machine, thanks!

@michel-slm
Copy link
Author

@FrostyX seems to work

You should restart:
  * Some applications using:
      dropbox stop; dropbox start
      pulseaudio --kill; pulseaudio --start

  * These applications manually:
      CopyAgent
      abrt-applet
      caribou
      chrome
      cryptkeeper
      deja-dup-monitor
      evolution-alarm-notify
      evolution-calendar-factory
      evolution-source-registry
      fedmsg-notify-d
      gnome-session
      gnome-settings-daemon
      gnome-shell
      gnome-shell-calendar-server
      gnome-software
      gnome-terminal-server
      gnome-user-share-obexpush
      goa-daemon
      gsd-printer
      gvfs-goa-volume-monitor
      gvfs-gphoto2-volume-monitor
      gvfs-mtp-volume-monitor
      gvfsd-burn
      gvfsd-fuse
      gvfsd-trash
      ibus-daemon
      ibus-dconf
      ibus-engine-simple
      ibus-x11
      mission-control-5
      nacl_helper
      nautilus
      sd-pam
      seapplet
      systemd
      tracker-extract
      tracker-miner-apps
      tracker-miner-fs
      tracker-miner-user-guides
      tracker-store

Additionally to those process above, there are:
  - 5 processes requiring reboot

@FrostyX
Copy link
Owner

FrostyX commented Feb 3, 2015

Great,
I will merge it and next version - tracer-0.5.7-1 will work for you.

Thank you

@michel-slm
Copy link
Author

Alright, should I wait until there's a build in Koji and then close this? Thanks!

@FrostyX
Copy link
Owner

FrostyX commented Feb 5, 2015

Please wait a while. I will try to release it as soon as possible and let you know :-)

@michel-slm
Copy link
Author

It should be safe to close this issue, right? I'm getting another issue with 0.5.8:

Traceback (most recent call last):
  File "/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 182, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 141, in _main
    ret = resolving(cli, base)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 160, in resolving
    base.do_transaction()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 221, in do_transaction
    self.plugins.run_transaction()
  File "/usr/lib/python2.7/site-packages/dnf/plugin.py", line 82, in fn
    dnf.util.mapall(operator.methodcaller(method), self.plugins)
  File "/usr/lib/python2.7/site-packages/dnf/util.py", line 157, in mapall
    return list(map(fn, *seq))
  File "/usr/lib/python2.7/site-packages/dnf-plugins/tracer.py", line 59, in transaction
    args = ["tracer", "-n"] + list(installed | erased)
NameError: global name 'installed' is not defined

@FrostyX
Copy link
Owner

FrostyX commented Mar 11, 2015

Thank you @michel-slm ,
now it seems to be a problem in the DNF plugin. Does sudo tracer command works as expected?

If yes, do you still using dnf-plugin-tracer package? Plugin was moved to DNF official repository and package is now called dnf-plugins-extras-tracer.

Please, does the new package work?

@michel-slm
Copy link
Author

@FrostyX I got automatically migrated to dnf-plugins-extras-tracer, so yes, that's the one I was using (dnf-plugins-extras-{common,tracer}-0.0.4-1.fc21)

Running "sudo tracer" does seem to work

You should restart:
  * Some applications using:
      pulseaudio --kill; pulseaudio --start

  * These applications manually:
      CopyAgent
      abrt-applet
      at-spi2-registryd
      caribou
      cat
      chrome
      chrome-sandbox
      cryptkeeper
      dconf-service
      deja-dup-monitor
      evolution-alarm-notify
      evolution-calendar-factory
      evolution-source-registry
      fedmsg-notify-d
      gnome-keyring-daemon
      gnome-pty-helper
      gnome-session
      gnome-settings-daemon
      gnome-shell
      gnome-shell-calendar-server
      gnome-software
      gnome-terminal-server
      gnome-user-share-obexpush
      goa-daemon
      gsd-printer
      gvfs-goa-volume-monitor
      gvfs-gphoto2-volume-monitor
      gvfs-mtp-volume-monitor
      gvfsd-burn
      gvfsd-fuse
      gvfsd-trash
      ibus-daemon
      ibus-dconf
      ibus-engine-simple
      ibus-x11
      mission-control-5
      nacl_helper
      nautilus
      obexd
      sd-pam
      seapplet
      systemd
      tracker-extract
      tracker-miner-apps
      tracker-miner-fs
      tracker-miner-user-guides
      tracker-store
      zsh

Additionally to those process above, there are:
  - 1 processes requiring restart of your session (i.e. Logging out & Logging in again)
  - 7 processes requiring reboot

@FrostyX
Copy link
Owner

FrostyX commented Mar 13, 2015

@michel-slm Sorry for little delay I had to got to my desktop computer. I am confirming the issue and going to solve it.

@FrostyX FrostyX added the bug label Mar 13, 2015
@FrostyX
Copy link
Owner

FrostyX commented Mar 14, 2015

Well, the issue was already fixed in rpm-software-management/dnf-plugins-extras@379b051 and it works fine on F22 and F23. Build for F21 failed for some reason. Please wait for an arbitrary update of the dnf-plugins-extras-tracer package and it will be alright.

@michel-slm
Copy link
Author

Aha, yes, works on my Fedora 22 test VM. Let's close this and I'll see if I can help debug the F21 build problem tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants