KeyError: 'port_id' exception in .trunk.drivers.linuxbridge.agent.driver.LinuxBridgeTrunkDriver.agent_port_change

Bug #1751302 reported by Thomas Morin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
BaGPipe
Fix Released
Undecided
Unassigned

Bug Description

I see the following traceback in some neutron linuxbridge agent logs:

neutron_lib.callbacks.manager [req-4f4fe77a-3d0e-44d3-b3ef-02a813575d58 - - - - -] Error during notification for neutron.services.trunk.drivers.linuxbridge.agent.driver.LinuxBridgeTrunkDriver.agent_port_change--9223372036854150104 port_device, after_update: KeyError: 'port_id'
 Traceback (most recent call last):
   File "/opt/stack/new/networking-bagpipe/.tox/dsvm-fullstack/local/lib/python2.7/site-packages/neutron_lib/callbacks/manager.py", line 171, in _notify_loop
     callback(resource, event, trigger, **kwargs)
   File "/opt/stack/new/networking-bagpipe/.tox/dsvm-fullstack/src/neutron/openstack/neutron/neutron/services/trunk/drivers/linuxbridge/agent/driver.py", line 91, in agent_port_change
     trunk = self._tapi.get_trunk(context, device_details['port_id'])
 KeyError: 'port_id'

Revision history for this message
Thomas Morin (tmmorin-orange) wrote :

Ok, the notification is like this:

            [...]
                self._update_network_ports(device_details['network_id'],
                                           device_details['port_id'],
                                           device_details['device'])
                self.ext_manager.handle_port(self.context, device_details)
                registry.notify(local_resources.PORT_DEVICE,
                                events.AFTER_UPDATE, self,
                                context=self.context,
                                device_details=device_details)

In fact, in the environment this appears, there is an agent extension that modifies [1] device_details. Ouch.

Updating affected project accordingly...

no longer affects: neutron
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-bagpipe (master)

Reviewed: https://review.openstack.org/547485
Committed: https://git.openstack.org/cgit/openstack/networking-bagpipe/commit/?id=f2afcdd00271a8dde18e521a362bd8f7953a69c1
Submitter: Zuul
Branch: master

commit f2afcdd00271a8dde18e521a362bd8f7953a69c1
Author: Thomas Morin <email address hidden>
Date: Fri Feb 23 16:41:50 2018 +0100

    bagpipe ml2: agent extension, do not modify device_details on callbacks

    Modifying the device details dictionnary on handle_port or delete_port
    callbacks is something that has, of course, side effects... :-/

    Change-Id: I412c310af40c4053451a2b9b4f8fcd741a85939a
    Closes-Bug: 1751302

Changed in networking-bagpipe:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-bagpipe (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/548020

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-bagpipe (stable/queens)

Reviewed: https://review.openstack.org/548020
Committed: https://git.openstack.org/cgit/openstack/networking-bagpipe/commit/?id=59a2650c5d5bb808000ab77f159db2151c1fee05
Submitter: Zuul
Branch: stable/queens

commit 59a2650c5d5bb808000ab77f159db2151c1fee05
Author: Thomas Morin <email address hidden>
Date: Fri Feb 23 16:41:50 2018 +0100

    bagpipe ml2: agent extension, do not modify device_details on callbacks

    Modifying the device details dictionnary on handle_port or delete_port
    callbacks is something that has, of course, side effects... :-/

    Change-Id: I412c310af40c4053451a2b9b4f8fcd741a85939a
    Closes-Bug: 1751302
    (cherry picked from commit f2afcdd00271a8dde18e521a362bd8f7953a69c1)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-bagpipe 9.0.0.0b1

This issue was fixed in the openstack/networking-bagpipe 9.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-bagpipe 8.0.1

This issue was fixed in the openstack/networking-bagpipe 8.0.1 release.

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.