"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
exarkun commented 2018-06-14 14:02:18 +00:00
Owner

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`).
tahoe-lafs added the
unknown
normal
defect
1.12.1
labels 2018-06-14 14:02:18 +00:00
tahoe-lafs added this to the undecided milestone 2018-06-14 14:02:18 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

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