This seems to affect any machine that has tun interfaces, which don't
have MAC addresses. E.g. anyone who runs OpenVPN. Please fix.

----[SNIP]----
$ sudo netplan apply
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 257, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 55, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 257, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 187, in 
command_apply
    changes = NetplanApply.process_link_changes(devices, config_manager)
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 283, in 
process_link_changes
    current_iface_name = utils.find_matching_iface(interfaces, match)
  File "/usr/share/netplan/netplan/cli/utils.py", line 199, in 
find_matching_iface
    matches = list(filter(lambda iface: is_interface_matching_macaddress(iface, 
match.get('macaddress')), matches))
  File "/usr/share/netplan/netplan/cli/utils.py", line 199, in <lambda>
    matches = list(filter(lambda iface: is_interface_matching_macaddress(iface, 
match.get('macaddress')), matches))
  File "/usr/share/netplan/netplan/cli/utils.py", line 185, in 
is_interface_matching_macaddress
    macaddress = get_interface_macaddress(interface)
  File "/usr/share/netplan/netplan/cli/utils.py", line 169, in 
get_interface_macaddress
    link = netifaces.ifaddresses(interface)[netifaces.AF_LINK][0]
KeyError: 17
----[SNAP]----

I am pretty sure this happens on interface='tun0'. On python cli:

>>> import netifaces
>>> netifaces.ifaddresses('tun0')[netifaces.AF_LINK]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 17

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1913062

Title:
  netplan apply backtrace

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1913062/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to