← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1856853] [NEW] OVSInterfaceDriver.plug_new should catch pyroute2.netlink.exceptions.NetlinkError

 

Public bug reported:

When "OVSInterfaceDriver.plug_new" is executed, if OVS is not using veth
pairs and the interface created is in a namespace, the method should
catch a different exception [1] now that the implementation of
"add_device_to_namespace" is done with Pyroute2.

In case of having a duplicated interface in the requested namespace when adding the interface, the exception raised is:
  pyroute2.netlink.exceptions.NetlinkError: (22, 'Invalid argument')


How to reproduce manually this issue and see the exception:
$ ip netns add ns01
$ python
>>> from neutron.agent.linux import ip_lib
>>> i=ip_lib.IPWrapper('ns01')
>>> _, int1 = i.add_veth('tap1', 'tap0', 'ns02')
>>> _, int2 = i.add_veth('tap2', 'tap0', 'ns03')
>>> ip = ip_lib.IPWrapper()
>>> ns = ip.ensure_namespace('ns01')
>>> ns.add_device_to_namespace(int1)
>>> ns.add_device_to_namespace(int2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/stack/neutron/neutron/agent/linux/ip_lib.py", line 263, in add_device_to_namespace
    device.link.set_netns(self.namespace)
  File "/opt/stack/neutron/neutron/agent/linux/ip_lib.py", line 456, in set_netns
    self.name, self._parent.namespace, net_ns_fd=namespace)
  File "/opt/stack/neutron/neutron/privileged/agent/linux/ip_lib.py", line 67, in sync_inner
    return input_func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/oslo_privsep/priv_context.py", line 245, in _wrap
    return self.channel.remote_call(name, args, kwargs)
  File "/usr/local/lib/python3.7/dist-packages/oslo_privsep/daemon.py", line 204, in remote_call
    raise exc_type(*result[2])
pyroute2.netlink.exceptions.NetlinkError: (22, 'Invalid argument')

** Affects: neutron
     Importance: Undecided
     Assignee: Rodolfo Alonso (rodolfo-alonso-hernandez)
         Status: New

** Changed in: neutron
     Assignee: (unassigned) => Rodolfo Alonso (rodolfo-alonso-hernandez)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1856853

Title:
  OVSInterfaceDriver.plug_new should catch
  pyroute2.netlink.exceptions.NetlinkError

Status in neutron:
  New

Bug description:
  When "OVSInterfaceDriver.plug_new" is executed, if OVS is not using
  veth pairs and the interface created is in a namespace, the method
  should catch a different exception [1] now that the implementation of
  "add_device_to_namespace" is done with Pyroute2.

  In case of having a duplicated interface in the requested namespace when adding the interface, the exception raised is:
    pyroute2.netlink.exceptions.NetlinkError: (22, 'Invalid argument')

  
  How to reproduce manually this issue and see the exception:
  $ ip netns add ns01
  $ python
  >>> from neutron.agent.linux import ip_lib
  >>> i=ip_lib.IPWrapper('ns01')
  >>> _, int1 = i.add_veth('tap1', 'tap0', 'ns02')
  >>> _, int2 = i.add_veth('tap2', 'tap0', 'ns03')
  >>> ip = ip_lib.IPWrapper()
  >>> ns = ip.ensure_namespace('ns01')
  >>> ns.add_device_to_namespace(int1)
  >>> ns.add_device_to_namespace(int2)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/opt/stack/neutron/neutron/agent/linux/ip_lib.py", line 263, in add_device_to_namespace
      device.link.set_netns(self.namespace)
    File "/opt/stack/neutron/neutron/agent/linux/ip_lib.py", line 456, in set_netns
      self.name, self._parent.namespace, net_ns_fd=namespace)
    File "/opt/stack/neutron/neutron/privileged/agent/linux/ip_lib.py", line 67, in sync_inner
      return input_func(*args, **kwargs)
    File "/usr/local/lib/python3.7/dist-packages/oslo_privsep/priv_context.py", line 245, in _wrap
      return self.channel.remote_call(name, args, kwargs)
    File "/usr/local/lib/python3.7/dist-packages/oslo_privsep/daemon.py", line 204, in remote_call
      raise exc_type(*result[2])
  pyroute2.netlink.exceptions.NetlinkError: (22, 'Invalid argument')

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1856853/+subscriptions


Follow ups