[tahoe-lafs-trac-stream] [tahoe-lafs] #1536: nicely report any errors involving finding and using ifconfig
tahoe-lafs
trac at tahoe-lafs.org
Fri Oct 5 14:07:27 UTC 2012
#1536: nicely report any errors involving finding and using ifconfig
------------------------------+-------------------------------------------
Reporter: zooko | Owner: zooko
Type: defect | Status: assigned
Priority: major | Milestone: undecided
Component: code-network | Version: 1.9.0a1
Resolution: | Keywords: error pyutil iputil archlinux
Launchpad Bug: |
------------------------------+-------------------------------------------
Old description:
> A couple of users have recently [http://tahoe-lafs.org/pipermail/tahoe-
> dev/2011-September/006676.html reported] errors from [http://tahoe-
> lafs.org/trac/tahoe-
> lafs/browser/trunk/src/allmydata/util/iputil.py?annotate=blame&rev=4971#L177
> iputil] when it couldn't find their {{{ifconfig}}} executable, e.g.:
>
> {{{
> [Failure instance: Traceback: <type 'exceptions.OSError'>: [Errno 2] No
> such file or directory
> /usr/lib/python2.7/threading.py:525:__bootstrap
> /usr/lib/python2.7/threading.py:552:__bootstrap_inner
> /usr/lib/python2.7/threading.py:505:run
> - --- <exception caught here> ---
> /usr/lib/python2.7/site-packages/twisted/python/threadpool.py:207:_worker
> /usr/lib/python2.7/site-
> packages/twisted/python/context.py:118:callWithContext
> /usr/lib/python2.7/site-
> packages/twisted/python/context.py:81:callWithContext
> /home/kytv/tahoe/allmydata-
> tahoe-1.8.3/src/allmydata/util/iputil.py:222:_synchronously_find_addresses_via_config
> /home/kytv/tahoe/allmydata-
> tahoe-1.8.3/src/allmydata/util/iputil.py:236:_query
> /usr/lib/python2.7/subprocess.py:679:__init__
> /usr/lib/python2.7/subprocess.py:1228:_execute_child
> ]
> calling os.abort()
> }}}
> We should catch this exception and report a useful error message, saying
> what the {{{sys.platform}}} was and asking them to report about their
> {{{ifconfig}}}, like David-Sarah [http://tahoe-lafs.org/pipermail/tahoe-
> dev/2011-September/006677.html did] on the list:
> {{{
> which ifconfig
> ifconfig --help
> ifconfig
> }}}
New description:
A couple of users have recently [http://tahoe-lafs.org/pipermail/tahoe-
dev/2011-September/006676.html reported] errors from [http://tahoe-
lafs.org/trac/tahoe-
lafs/browser/trunk/src/allmydata/util/iputil.py?annotate=blame&rev=4971#L177
iputil] when it couldn't find their {{{ifconfig}}} executable, e.g.:
{{{
[Failure instance: Traceback: <type 'exceptions.OSError'>: [Errno 2] No
such file or directory
/usr/lib/python2.7/threading.py:525:__bootstrap
/usr/lib/python2.7/threading.py:552:__bootstrap_inner
/usr/lib/python2.7/threading.py:505:run
- --- <exception caught here> ---
/usr/lib/python2.7/site-packages/twisted/python/threadpool.py:207:_worker
/usr/lib/python2.7/site-
packages/twisted/python/context.py:118:callWithContext
/usr/lib/python2.7/site-
packages/twisted/python/context.py:81:callWithContext
/home/kytv/tahoe/allmydata-
tahoe-1.8.3/src/allmydata/util/iputil.py:222:_synchronously_find_addresses_via_config
/home/kytv/tahoe/allmydata-
tahoe-1.8.3/src/allmydata/util/iputil.py:236:_query
/usr/lib/python2.7/subprocess.py:679:__init__
/usr/lib/python2.7/subprocess.py:1228:_execute_child
]
calling os.abort()
}}}
We should catch this exception and report a useful error message, saying
what the {{{sys.platform}}} was and asking them to report about their
{{{ifconfig}}}, like David-Sarah [http://tahoe-lafs.org/pipermail/tahoe-
dev/2011-September/006677.html did] on the list:
{{{
which ifconfig
ifconfig --help
ifconfig
}}}
--
Comment (by mk.fg):
I've just created [https://github.com/tahoe-lafs/tahoe-lafs/pull/14 pull
request (#14) on github] with a simple patch to use $PATH to find
ifconfig.
A few questions that went through my mind during that process:
* Is there any particular reason why it's used only on windows?
* Why OS-native path resolution mechanics (which Popen() will use through
os.execvp()) are overidden with twisted which() util?
I considered adding optional iproute2 support, as suggested above (and
indeed, net-tools are deprecated in many distros), but I think it's a
wrong way to do it - iproute2 docs clearly state that it's output is a
subject to change (and it's usually updated once per kernel release) and
is not designed to be parseable, so maybe some specialized netlink module
should be used on linux instead?
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1536#comment:5>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list