nvp test_routers test suite fail due to KeyError 'distributed'

Bug #1220931 reported by Bhuvan Arumugam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Armando Migliaccio

Bug Description

We use nvp 2.2, python 2.6, Oracle Linux 6.3, if it matters.

The tempest fail when executing any of 3 tests defined in test_routers suite.
  1. test_add_remove_router_interface_with_port_id
  2. test_add_remove_router_interface_with_subnet_id
  3. test_create_show_list_update_delete_router

 The tempest fail with following error:
 Details: {"NeutronError": "Request Failed: internal server error while processing your request."}

    The neutron.log says:
    2013-09-03 18:45:43,004 (neutron.api.v2.resource): ERROR resource resource create failed
    Traceback (most recent call last):
        File ".../python2.6/site-packages/neutron/api/v2/resource.py", line 84, in resource
            result = method(request=request, **args)
        File ".../python2.6/site-packages/neutron/api/v2/base.py", line 405, in create
            obj = obj_creator(request.context, **kwargs)
        File ".../python2.6/site-packages/neutron/plugins/nicira/NeutronPlugin.py", line 1641, in create_router
            r['distributed'] = lrouter['distributed']
        KeyError: 'distributed'

We have not defined default_router_type in our config files. I'd presume, it use centralized router type, by default. In such case, possibly the lrouter doesn't have 'distribtued' key defined. We should possibly check if key exist, before accessing it.

OTOH, if it's not supposed to work with nvp 2.2, let me know a workaround to fix tempest execute these test cases.

In case you need more info, let me know.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Um...I am straw here; this patch:

https://review.openstack.org/#/c/41795/

The functionality worked from NVP 3.2 onwards and return BadRequest for anything lower.

Can you provide more information on what version of neutron you're running?

Changed in neutron:
status: New → Incomplete
assignee: nobody → Armando Migliaccio (armando-migliaccio)
Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

If the router is not distributed, NVP plugin always expect a distributed attribute to be returned.
However older platforms do not return that attribute at all.
__getitem__ must be replaced by a get()

Changed in neutron:
status: Incomplete → Confirmed
status: Confirmed → Triaged
status: Triaged → Incomplete
status: Incomplete → Triaged
milestone: none → havana-rc1
importance: Undecided → Medium
Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

sorry armando i did not meant assigning this to you :)
always you slave

Changed in neutron:
assignee: Armando Migliaccio (armando-migliaccio) → Salvatore Orlando (salvatore-orlando)
Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

We verified issue is solved in current trunk code. please confirm and change state if necessary.

Changed in neutron:
status: Triaged → Invalid
milestone: havana-rc1 → none
assignee: Salvatore Orlando (salvatore-orlando) → nobody
importance: Medium → Undecided
Changed in neutron:
status: Invalid → Incomplete
assignee: nobody → Salvatore Orlando (salvatore-orlando)
Revision history for this message
Yang Yu (yuyangbj) wrote : I will be on vacation from 9/5 to 9/15, urgent call: 13811509950

I will be out of the office starting 2013-09-05 and will not return until
2013-09-15.

I will be on my marriage leave from 9/5 to 9/15, for any urgent issue
please call me before 9/7.

For daily work, please ask my scrum master Zhu Zhu for help.
For glance issue, please ask glance SME Feilong Wang for help.
For defect report, there will be no report next week.

Revision history for this message
Bhuvan Arumugam (bhuvan) wrote :

we use neutron 2013.2.a462.g71bbefb. This patch was already part of this installation:
https://review.openstack.org/#/c/41795/

Changed in neutron:
status: Incomplete → Confirmed
assignee: Salvatore Orlando (salvatore-orlando) → Armando Migliaccio (armando-migliaccio)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/45778

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/45778
Committed: http://github.com/openstack/neutron/commit/5281b806d2e54f6b8a589e1e4acde3d434b31723
Submitter: Jenkins
Branch: master

commit 5281b806d2e54f6b8a589e1e4acde3d434b31723
Author: armando-migliaccio <email address hidden>
Date: Mon Sep 9 14:54:32 2013 -0700

    Avoid KeyError 'distributed' exception when using NVP <3.x

    This patch fixes an issue found when creating routers with
    NVP plugin and NVP platform 2.2

    Fixes bug 1220931

    Change-Id: Ia7b358b59e48a723c07efec015bb650accaa3322

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
Bhuvan Arumugam (bhuvan) wrote :

I confirm the fix works. The tempest tests for test_routers don't fail anymore, with this fix.

Changed in neutron:
milestone: none → havana-rc1
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-rc1 → 2013.2
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.