[tor-bugs] #32049 [Core Tor/Stem]: stem/util/proc.py", line 448, in _inodes_for_sockets FileNotFoundError: [Errno 2]

Tor Bug Tracker & Wiki blackhole at torproject.org
Sun Oct 13 09:00:29 UTC 2019


#32049: stem/util/proc.py", line 448, in _inodes_for_sockets FileNotFoundError:
[Errno 2]
--------------------------------+-------------------------------
 Reporter:  toralf              |          Owner:  atagar
     Type:  defect              |         Status:  new
 Priority:  Medium              |      Component:  Core Tor/Stem
  Version:  Tor: 0.4.2.2-alpha  |       Severity:  Normal
 Keywords:                      |  Actual Points:
Parent ID:                      |         Points:
 Reviewer:                      |        Sponsor:
--------------------------------+-------------------------------
 Running https://github.com/toralf/torutils/blob/master/ps.py for about 30
 minutes at a Tor relay gives
 {{{
  port     # opened closed     max                ( proc:9051, 6630 conns
 0.24 sec )
   5222    62                     62      3      1  (Jabber)
   5280     1                      1                (None)
   6660                            4             2  (IRC)
   6666                            1      1      1  (IRC)
   6667     1                      3      1      1  (IRC)
   6697     3                      3                (IRC)
 Traceback (most recent call last):
   File "/usr/lib64/python3.6/site-packages/stem/util/proc.py", line 448,
 in _inodes_for_sockets
     fd_name = os.readlink(fd_path)
 FileNotFoundError: [Errno 2] No such file or directory:
 '/proc/2284/fd/5280'

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/opt/torutils/ps.py", line 178, in <module>
     main()
   File "/opt/torutils/ps.py", line 102, in main
     connections =
 get_connections(resolver=resolver,process_pid=pid,process_name='tor')
   File "/usr/lib64/python3.6/site-packages/stem/util/connection.py", line
 236, in get_connections
     return stem.util.proc.connections(pid = process_pid)
   File "/usr/lib64/python3.6/site-packages/stem/util/proc.py", line 374,
 in connections
     inodes = _inodes_for_sockets(pid) if pid else set()
   File "/usr/lib64/python3.6/site-packages/stem/util/proc.py", line 457,
 in _inodes_for_sockets
     raise IOError('unable to determine file descriptor destination (%s):
 %s' % (exc, fd_path))
 OSError: unable to determine file descriptor destination ([Errno 2] No
 such file or directory: '/proc/2284/fd/5280'): /proc/2284/fd/5280

 }}}
 FWIW:
 {{{
 mr-fox ~ # ls /proc/2284/fd | wc
    7148    7148   34630
 mr-fox ~ # for p in 9051 ; do python
 /usr/share/doc/stem-1.7.1/_static/example/relay_connections.py --ctrlport
 $p; done
  0.4.2.2-alpha   uptime: 1-16:08:14   flags: Fast, Guard, Running, Stable,
 V2Dir, Valid

 +------------------------------+------+------+
 | Type                         | IPv4 | IPv6 |
 +------------------------------+------+------+
 | Inbound to our ORPort        | 3661 |    4 |
 | Inbound to our DirPort       |    2 |    0 |
 | Inbound to our ControlPort   |    1 |    0 |
 | Outbound to a relay          | 2889 |    0 |
 | Outbound exit traffic        |   63 |    6 |
 | Outbound uncategorized       |    8 |    0 |
 +------------------------------+------+------+
 | Total                        | 6624 |   10 |
 +------------------------------+------+------+

 +------------------------------+------+------+
 | Exit Port                    | IPv4 | IPv6 |
 +------------------------------+------+------+
 | 5222 (Jabber)                |   54 |    5 |
 | 5280                         |    1 |    0 |
 | 6667 (IRC)                   |    6 |    0 |
 | 6697 (IRC)                   |    2 |    1 |
 +------------------------------+------+------+
 | Total                        |   63 |    6 |
 +------------------------------+------+------+

 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/32049>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list