netplan KeyError with gretap in bridge

Bug #1905156 reported by Joel Sing
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
Fix Released
Undecided
Unassigned
netplan.io (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

With version 0.100-0ubuntu4~20.04.3 on Ubuntu focal, using the following config:

network:
  version: 2
  renderer: networkd
  ethernets:
    lo:
      match:
        name: lo
      addresses: [ 172.16.100.2/32 ]
    eth0:
      dhcp4: true
  bridges:
    br0:
      interfaces: [eth0, gretap1]
      addresses: [10.0.0.5/24]
  vlans:
    en-intra:
      id: 2999
      link: eth0
  tunnels:
    gretap1:
      mode: gretap
      remote: 2.2.2.2
      local: 1.1.1.1

Results in:

# 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 211, 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 211, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 154, in command_apply
    NetplanApply.process_ovs_cleanup(config_manager, old_files_ovs, restart_ovs, exit_on_error)
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 324, in process_ovs_cleanup
    apply_ovs_cleanup(config_manager, ovs_old, ovs_current)
  File "/usr/share/netplan/netplan/cli/ovs.py", line 119, in apply_ovs_cleanup
    if (is_ovs_interface(i, config_manager.interfaces)):
  File "/usr/share/netplan/netplan/cli/ovs.py", line 105, in is_ovs_interface
    return any(is_ovs_interface(i, interfaces) for i in interfaces[iface].get('interfaces', []))
  File "/usr/share/netplan/netplan/cli/ovs.py", line 105, in <genexpr>
    return any(is_ovs_interface(i, interfaces) for i in interfaces[iface].get('interfaces', []))
  File "/usr/share/netplan/netplan/cli/ovs.py", line 102, in is_ovs_interface
    if interfaces[iface].get('openvswitch') is not None:
KeyError: 'gretap1'

The 'gretap1' interface has to be removed from the br0 interfaces list, in order for this to apply.

This is a regression from 0.99-0ubuntu1, which does not appear to have this bug.

Tags: fr-960

Related branches

Revision history for this message
Lukas Märdian (slyon) wrote :

This looks similar to bug #1904633

tags: added: fr-960
Revision history for this message
Lukas Märdian (slyon) wrote :

I think this should actually already be fixed upstream via https://github.com/CanonicalLtd/netplan/pull/163 where the tunnel interfaces were added to the python parser (configmanager.py). I will prepare a test-case to make sure it always works in the future.

Revision history for this message
Lukas Märdian (slyon) wrote :

test case and extra protection here: https://github.com/CanonicalLtd/netplan/pull/172

Changed in netplan:
status: New → Confirmed
Lukas Märdian (slyon)
Changed in netplan:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.101-0ubuntu1

---------------
netplan.io (0.101-0ubuntu1) hirsute; urgency=medium

  * New upstream release: 0.101
    - Documentation improvements
    - Improved integration tests
    - Add more examples for Wireguard, Open vSwitch, DBus
    - Improve test stability
    - Implementation of DBus Config/Get/Set/Try APIs
    - Add per-route MTU option (LP: #1860201)
    Bug fixes:
    - Fix MAAS OVS first boot (LP: #1898997)
    - Fix match of duplicate MAC on VLANs (LP: #1888726)
    - Fix crash in Python parser (LP: #1904633) (LP: #1905156)
    - Fix rename of matched interfaces at runtime (LP: #1904662)
  * Drop all distro patches, which have been integrated upstream
  * Update symbols file

 -- Lukas Märdian <email address hidden> Wed, 09 Dec 2020 09:41:50 +0100

Changed in netplan.io (Ubuntu):
status: New → Fix Released
Revision history for this message
Lukas Märdian (slyon) wrote :

Fixed as of v0.101

Changed in netplan:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.