#1536 closed defect (fixed)

nicely report any errors involving finding and using ifconfig

Reported by: zooko Owned by:
Priority: major Milestone: 1.15.0
Component: code-network Version: 1.9.0a1
Keywords: error pyutil iputil archlinux transparency review Cc:
Launchpad Bug:

Description (last modified by zooko)

A couple of users have recently reported errors from 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 did on the list:

which ifconfig
ifconfig --help
ifconfig

Change History (15)

comment:1 Changed at 2011-09-15T20:26:49Z by Brian Warner <warner@…>

In 8e69b94588c1c0e7:

Make platform-detection code tolerate linux-3.0, patch by zooko.

Otherwise address-autodetection can't find ifconfig. refs #1536

comment:2 Changed at 2011-09-15T23:16:17Z by davidsarah

Re: 8e69b94588c1c0e7, I would be tempted to use .startswith('linux') and .startswith('irix', rather than testing for more specific strings.

Version 0, edited at 2011-09-15T23:16:17Z by davidsarah (next)

comment:3 in reply to: ↑ description Changed at 2011-09-16T05:27:50Z by killyourtv

comment:4 Changed at 2011-09-28T15:01:13Z by zooko

  • Owner set to zooko
  • Status changed from new to assigned

comment:5 Changed at 2012-10-05T14:07:27Z by mk.fg

I've just created 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 ($PATH) 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?

Last edited at 2012-10-05T14:14:24Z by mk.fg (previous) (diff)

comment:6 Changed at 2013-05-27T17:07:44Z by zooko

  • Description modified (diff)

Hi mk.fg! I was just investigating related bugs and I discovered this comment you added to this ticket. I'm sorry I didn't see it when you first posted it! I need to get more reliable monitoring of updates to trac+github...

comment:7 Changed at 2013-05-27T17:30:28Z by zooko

See #1988.

comment:8 Changed at 2013-05-27T17:37:24Z by zooko

  • Keywords transparency added

comment:9 Changed at 2013-06-25T18:15:57Z by Daira Hopwood <david-sarah@…>

In a493ee0bb641175ecf918e28fce4d25df15994b6/trunk:

iputil.py: add tests for recent changes. refs #1381, #1988, #982, #1064, #1536, #1935, #898, #1707, #1918

Signed-off-by: Daira Hopwood <david-sarah@…>

comment:10 Changed at 2015-04-01T16:51:49Z by daira

  • Milestone changed from undecided to 1.11.0

comment:11 Changed at 2016-03-22T05:02:52Z by warner

  • Milestone changed from 1.11.0 to 1.12.0

Milestone renamed

comment:12 Changed at 2016-06-28T18:20:37Z by warner

  • Milestone changed from 1.12.0 to 1.13.0

moving most tickets from 1.12 to 1.13 so we can release 1.12 with magic-folders

comment:13 Changed at 2020-06-30T14:45:13Z by exarkun

  • Milestone changed from 1.13.0 to 1.15.0

Moving open issues out of closed milestones.

comment:14 Changed at 2020-10-23T20:00:52Z by exarkun

  • Keywords review added
  • Owner zooko deleted
  • Status changed from assigned to new

https://github.com/tahoe-lafs/tahoe-lafs/pull/872 removes use of ifconfig entirely

comment:15 Changed at 2020-10-26T16:12:48Z by exarkun

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.