zhengzheng / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

get_io_counters() fails on Red Hat Enterprise Linux AS release 4 (Nahant Update 5) / Python 2.6.4 #275

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

>>> psutil.Process(os.getpid()).get_io_counters()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/oweidner/software/bigjob-bliss/lib/python2.6/site-packages/psutil/__init__.py", line 265, in get_io_counters
    return self._platform_impl.get_process_io_counters()
  File "/home/oweidner/software/bigjob-bliss/lib/python2.6/site-packages/psutil/_pslinux.py", line 327, in wrapper
    raise NoSuchProcess(self.pid, self._process_name)
psutil.error.NoSuchProcess: process no longer exists (pid=24890)

What is the expected output?

I/O counters

What do you see instead?

psutil.error.NoSuchProcess: process no longer exists (pid=24890)

What version of psutil are you using? What Python version?

psutil-0.4.1

On what operating system? Is it 32bit or 64bit version?

x86_64

Please provide any additional information below.

Original issue reported on code.google.com by ole.weid...@rutgers.edu on 5 Jun 2012 at 2:38

GoogleCodeExporter commented 9 years ago
That's strange.
Do you have /proc/self/io file?

Original comment by g.rodola on 5 Jun 2012 at 3:13

GoogleCodeExporter commented 9 years ago
Strange indeed: I don't have that file.

bash-3.00$ ls -l /proc/self/
total 0
dr-xr-xr-x  2 oweidner lsuusers 0 Jun  5 10:14 attr
-r--------  1 oweidner lsuusers 0 Jun  5 10:14 auxv
-r--r--r--  1 oweidner lsuusers 0 Jun  5 10:14 cmdline
-rw-r--r--  1 oweidner lsuusers 0 Jun  5 10:14 coredump_filter
lrwxrwxrwx  1 oweidner lsuusers 0 Jun  5 10:14 cwd -> /home/oweidner
-r--------  1 oweidner lsuusers 0 Jun  5 10:14 environ
lrwxrwxrwx  1 oweidner lsuusers 0 Jun  5 10:14 exe -> /bin/ls
dr-x------  2 oweidner lsuusers 0 Jun  5 10:14 fd
-r--------  1 oweidner lsuusers 0 Jun  5 10:14 limits
-rw-r--r--  1 oweidner lsuusers 0 Jun  5 10:14 loginuid
-r--r--r--  1 oweidner lsuusers 0 Jun  5 10:14 maps
-rw-------  1 oweidner lsuusers 0 Jun  5 10:14 mem
-r--r--r--  1 oweidner lsuusers 0 Jun  5 10:14 mounts
-r--------  1 oweidner lsuusers 0 Jun  5 10:14 mountstats
-r--r--r--  1 oweidner lsuusers 0 Jun  5 10:14 numa_maps
lrwxrwxrwx  1 oweidner lsuusers 0 Jun  5 10:14 root -> /
-r--------  1 oweidner lsuusers 0 Jun  5 10:14 smaps
-r--r--r--  1 oweidner lsuusers 0 Jun  5 10:14 stat
-r--r--r--  1 oweidner lsuusers 0 Jun  5 10:14 statm
-r--r--r--  1 oweidner lsuusers 0 Jun  5 10:14 status
dr-xr-xr-x  3 oweidner lsuusers 0 Jun  5 10:14 task
-r--r--r--  1 oweidner lsuusers 0 Jun  5 10:14 wchan

It might have something to do with the kernel, or more specifically the lustre 
filesystem? 

uname -a

Linux qb1 2.6.9-78.0.22.EL_lustre.1.6.7.2_loni #1 SMP Fri Nov 13 18:49:37 CST 
2009 x86_64 x86_64 x86_64 GNU/Linux

Original comment by ole.weid...@rutgers.edu on 5 Jun 2012 at 3:17

GoogleCodeExporter commented 9 years ago
I have no idea but it seems /io is not the only thing missing on your linux box.
On my Ubuntu 12.04 I get:

giampaolo@ubuntu:~/svn/psutil$ ls -l /proc/self/
totale 0
dr-xr-xr-x 2 giampaolo giampaolo 0 giu  5 18:27 attr
-rw-r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 autogroup
-r-------- 1 giampaolo giampaolo 0 giu  5 18:27 auxv
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 cgroup
--w------- 1 giampaolo giampaolo 0 giu  5 18:27 clear_refs
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 cmdline
-rw-r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 comm
-rw-r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 coredump_filter
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 cpuset
lrwxrwxrwx 1 giampaolo giampaolo 0 giu  5 18:27 cwd -> 
/home/giampaolo/svn/psutil
-r-------- 1 giampaolo giampaolo 0 giu  5 18:27 environ
lrwxrwxrwx 1 giampaolo giampaolo 0 giu  5 18:27 exe -> /bin/ls
dr-x------ 2 giampaolo giampaolo 0 giu  5 18:27 fd
dr-x------ 2 giampaolo giampaolo 0 giu  5 18:27 fdinfo
-r-------- 1 giampaolo giampaolo 0 giu  5 18:27 io
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 latency
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 limits
-rw-r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 loginuid
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 maps
-rw------- 1 giampaolo giampaolo 0 giu  5 18:27 mem
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 mountinfo
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 mounts
-r-------- 1 giampaolo giampaolo 0 giu  5 18:27 mountstats
dr-xr-xr-x 5 giampaolo giampaolo 0 giu  5 18:27 net
dr-x--x--x 2 giampaolo giampaolo 0 giu  5 18:27 ns
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 numa_maps
-rw-r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 oom_adj
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 oom_score
-rw-r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 oom_score_adj
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 pagemap
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 personality
lrwxrwxrwx 1 giampaolo giampaolo 0 giu  5 18:27 root -> /
-rw-r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 sched
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 schedstat
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 sessionid
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 smaps
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 stack
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 stat
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 statm
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 status
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 syscall
dr-xr-xr-x 3 giampaolo giampaolo 0 giu  5 18:27 task
-r--r--r-- 1 giampaolo giampaolo 0 giu  5 18:27 wchan

Original comment by g.rodola on 5 Jun 2012 at 4:28

GoogleCodeExporter commented 9 years ago
Hm, yeah -- it's a 5 year old 700-node cluster and I guess that makes it by 
definition a strange machine. 

However, do you think it would make sense to fix the implementation so that 
p.get_io_counters() raises and AttributeError (like on OS X) instead of 
claiming that the 'process no longer exists'? 

Original comment by ole.weid...@rutgers.edu on 5 Jun 2012 at 4:34

GoogleCodeExporter commented 9 years ago
Definitively. I'll make it raise NotImplementedError though.
Done in r1339.

Original comment by g.rodola on 5 Jun 2012 at 4:49

GoogleCodeExporter commented 9 years ago
0.5.0 is finally out. Closing out as fixed.

Original comment by g.rodola on 27 Jun 2012 at 6:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Updated csets after the SVN -> Mercurial migration:
r1339 == revision ???

Original comment by g.rodola on 2 Mar 2013 at 12:08