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

ValueError: ambiguos inode with multiple PIDs references #572

Closed
bbinet opened this issue Jan 8, 2015 · 10 comments · Fixed by #575
Closed

ValueError: ambiguos inode with multiple PIDs references #572

bbinet opened this issue Jan 8, 2015 · 10 comments · Fixed by #575

Comments

@bbinet
Copy link
Contributor

bbinet commented Jan 8, 2015

I get the following exception when I use the psutil.net_connections(kind='tcp') method:

Traceback (most recent call last):
  File "/usr/local/bin/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/local/bin/bottle.py", line 1732, in wrapper
    rv = callback(*a, **ka)
  File "/usr/local/lib/python2.7/dist-packages/rsm/server.py", line 84, in check
    db[uuid].update(netstat(db[uuid]['port']))
  File "/usr/local/lib/python2.7/dist-packages/rsm/server.py", line 37, in netstat
    for c in psutil.net_connections(kind='tcp'):
  File "/usr/local/lib/python2.7/dist-packages/psutil/__init__.py", line 1816, in net_connections
    return _psplatform.net_connections(kind)
  File "/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py", line 530, in net_connections
    return _connections.retrieve(kind)
  File "/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py", line 514, in retrieve
    for fd, family, type_, laddr, raddr, status, bound_pid in ls:
  File "/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py", line 453, in process_inet
    raise ValueError("ambiguos inode with multiple "
ValueError: ambiguos inode with multiple PIDs references

I've found that the #497 issue is similar, but I'm using psutil latest 2.2.0 version which should not be affected.
Anyway, #497 patch prevent to throw the exception when family is socket.AF_UNIX but in my case family is socket.AF_INET, so the exception is raised. My question is why do you consider having multiple references to the same inode is abnormal?

If this is actually abnormal I don't know why I reach this point... May be this is due to my code living in a docker container? I don't know. Any other idea?

@bbinet
Copy link
Contributor Author

bbinet commented Jan 13, 2015

do you think it would be safe to just remove these offending lines: https://github.com/giampaolo/psutil/blob/master/psutil/_pslinux.py#L449-454

@bbinet
Copy link
Contributor Author

bbinet commented Jan 13, 2015

note that when I manually comment out these lines https://github.com/giampaolo/psutil/blob/master/psutil/_pslinux.py#L449-454 it fixes my issue and everything then work as expected for me.

@giampaolo
Copy link
Owner

What if you comment out those lines then run tests?

@bbinet
Copy link
Contributor Author

bbinet commented Jan 14, 2015

It looks like tests still pass: https://travis-ci.org/giampaolo/psutil/builds/46975016

@bbinet
Copy link
Contributor Author

bbinet commented Jan 19, 2015

@giampaolo do you think #575 could be merged?

@giampaolo
Copy link
Owner

Hey, sorry for the delay but I've been busy. Yes, I think that should be merged. I'd only ask to comment everything out (as opposed to remove those lines) then we can merge it.

bbinet added a commit to bbinet/psutil that referenced this issue Jan 20, 2015
@bbinet
Copy link
Contributor Author

bbinet commented Jan 20, 2015

Ok, I've just updated the pull request as requested.

@bbinet
Copy link
Contributor Author

bbinet commented Jan 23, 2015

Do you think you can now merge #575 so that the fix will be included in the next release?
By the way, when do you think you will release v2.2.1?

@giampaolo
Copy link
Owner

2.2.1 is out

@bbinet
Copy link
Contributor Author

bbinet commented Feb 2, 2015

Thanks!

bbinet added a commit to bbinet/reverse-ssh-manager that referenced this issue Feb 2, 2015
nkorb pushed a commit to grnet/cephtools that referenced this issue May 9, 2018
* Bugs in python-psutil
  Need to upgrade to package from jessie-backports in order
  to address the following issues:
    giampaolo/psutil#522
    giampaolo/psutil#572

* Race when checking for processes
  It seems that is possible to query for a process that no longer
  exists. Handle that situation by ignoring it.

* Wrong message when no processes are matches
  Not a problem at all, but handle that situation by printing a
  different message, just to be clear.

* Filter out qemu-system-x86_64 processes that do not have Ceph disks
  For some reason, it seems that QEMU maps librados and librbd
  libraries even when not using them (ie NFS, DRBD). Add a function
  that parses the cmdline of each QEMU process, looks for disk drives,
  and by looking at the path, tells if we should check that process or
  not. Only check VMs with rbd and tapdev (Archipelago) disks.

Also, split out process filtering stuff to a separate function.
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.

2 participants