"AUTO" Tub location detection/assignment is silently broken when system tools are missing #2930

Open
opened 2018-06-14 14:02:18 +00:00 by exarkun · 0 comments

Node.get_tub_portlocation attempts to automatically allocate and detect a listening address for the Tub if none has been explicitly configured. In this case, it uses allmydata.util.iputil.get_local_addresses_sync. get_local_addresses_sync may return an empty list if neither ip nor ifconfig can be found or if both of these tools return only errors or only empty address lists. If an empty address list is returned, get_tub_portlocation nevertheless proceeds to construct a fURL for the Tub which contains no location hints. Such a fURL is arguably useless since no piece of Tahoe-LAFS-related software will be able to use it to establish a connection.

get_local_addresses_sync could be made more robust (and probably simpler and faster, too) by using something like the netifaces package.

get_tub_portlocation could be made less surprising by failing loudly and immediately if asked to allocate/detect an address and then discovering it is unable to (ie, getting an empty local addresses list) rather than quietly writing garbage to a configuration file for someone to later trip over (it took me multiple hours to trace the misbehavior from the place where the problem was observed and reported back to get_local_addresses_sync and get_tub_portlocation).

`Node.get_tub_portlocation` attempts to automatically allocate and detect a listening address for the Tub if none has been explicitly configured. In this case, it uses `allmydata.util.iputil.get_local_addresses_sync`. `get_local_addresses_sync` may return an empty list if neither `ip` nor `ifconfig` can be found or if both of these tools return only errors or only empty address lists. If an empty address list is returned, `get_tub_portlocation` nevertheless proceeds to construct a fURL for the Tub which contains no location hints. Such a fURL is arguably useless since no piece of Tahoe-LAFS-related software will be able to use it to establish a connection. `get_local_addresses_sync` could be made more robust (and probably simpler and faster, too) by using something like the `netifaces` package. `get_tub_portlocation` could be made less surprising by failing loudly and immediately if asked to allocate/detect an address and then discovering it is unable to (ie, getting an empty local addresses list) rather than quietly writing garbage to a configuration file for someone to later trip over (it took me multiple hours to trace the misbehavior from the place where the problem was observed and reported back to `get_local_addresses_sync` and `get_tub_portlocation`).
exarkun added the
unknown
normal
defect
1.12.1
labels 2018-06-14 14:02:18 +00:00
exarkun added this to the undecided milestone 2018-06-14 14:02:18 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#2930
No description provided.