neutron error when trying to update a bgp peer

Bug #1616066 reported by Antonio Ojea
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Sreekumar S

Bug Description

Trying to update a bgp peer in Mitaka with midonet-plugin installed neutron throws an error.

root@controller:~# neutron bgp-peer-update --name BGP-Peer22 46b91ae4-990c-4d23-9dab-905eae0ec364; tail -f /var/log/neutron/neutron-server.log
Request Failed: internal server error while processing your request.
Neutron server returns request_ids: ['req-4bd46532-1bd5-464c-8f3b-56321c3404fb']
2016-08-23 09:33:27.040 18778 ERROR neutron.api.v2.resource obj = obj_updater(request.context, id, **kwargs)
2016-08-23 09:33:27.040 18778 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/oslo_log/helpers.py", line 46, in wrapper
2016-08-23 09:33:27.040 18778 ERROR neutron.api.v2.resource return method(*args, **kwargs)
2016-08-23 09:33:27.040 18778 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/midonet/neutron/services/bgp/plugin.py", line 183, in update_bgp_peer
2016-08-23 09:33:27.040 18778 ERROR neutron.api.v2.resource context, bgp_peer_id, bgp_peer)
2016-08-23 09:33:27.040 18778 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/db/bgp_db.py", line 269, in update_bgp_peer
2016-08-23 09:33:27.040 18778 ERROR neutron.api.v2.resource if ((bp['password'] is not None) and
2016-08-23 09:33:27.040 18778 ERROR neutron.api.v2.resource KeyError: 'password'
2016-08-23 09:33:27.040 18778 ERROR neutron.api.v2.resource
2016-08-23 09:33:27.052 18778 INFO neutron.wsgi [req-4bd46532-1bd5-464c-8f3b-56321c3404fb 51a6b639fa6d4205a82c11fafb5e5033 d3d205605c8d4d97808e6ab50a17b26a - - -] 10.99.99.20 - - [23/Aug/2016 09:33:27] "PUT /v2.0/bgp-peers/46b91ae4-990c-4d23-9dab-905eae0ec364.json HTTP/1.1" 500 383 0.022151

Miguel Lavalle (minsel)
tags: added: l3-bgp
Revision history for this message
Ryan Tidwell (ryan-tidwell) wrote :

Looks like a simple fix. If you look at [1], we should use "bp.get('password')" instead of "bp['password']".

[1] https://github.com/openstack/neutron/blob/stable/mitaka/neutron/db/bgp_db.py#L269

Changed in neutron:
status: New → Confirmed
tags: added: mitaka-backport-potential
Changed in neutron:
importance: Undecided → High
Revision history for this message
Antonio Ojea (aojea) wrote :

@ryan-tidwell is this supposed to be fixed on master first? I can't find the file there.

Changed in neutron:
assignee: nobody → venkatamahesh (venkatamaheshkotha)
Revision history for this message
Ryan Tidwell (ryan-tidwell) wrote :

@itsuugo The fix on master should be made in the neutron-dynamic-routing project. See https://github.com/openstack/neutron-dynamic-routing/blob/master/neutron_dynamic_routing/db/bgp_db.py

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-dynamic-routing (master)

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

Changed in neutron:
assignee: venkatamahesh (venkatamaheshkotha) → Sreekumar S (sreesiv)
status: Confirmed → In Progress
Changed in neutron:
milestone: none → newton-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-dynamic-routing (master)

Reviewed: https://review.openstack.org/367460
Committed: https://git.openstack.org/cgit/openstack/neutron-dynamic-routing/commit/?id=89ed530fecf4b41aa331c7594496d2a048f4d682
Submitter: Jenkins
Branch: master

commit 89ed530fecf4b41aa331c7594496d2a048f4d682
Author: Sreekumar S <email address hidden>
Date: Thu Sep 8 20:44:42 2016 +0530

    Fixes KeyError while updating bgp peer

    This will fix the issue of KeyError being thrown when
    'password' is not supplied while updating bgp peer.
    The dict get() method is used to return None when
    'password' key is not available.

    Two unit tests are also added which will test the cases
    1) Exception thrown if the auth type is 'none', and a
    password is supplied when updating
    2) When the password is not supplied

    Change-Id: Ief9e88ca12b04eb08b0cc4e60f9d883f1e282ae9
    Closes-Bug: #1616066

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/372244

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/mitaka)

Reviewed: https://review.openstack.org/372244
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=788d889b24f79345990b8bca7e9a41e6f0e03e42
Submitter: Jenkins
Branch: stable/mitaka

commit 788d889b24f79345990b8bca7e9a41e6f0e03e42
Author: Sreekumar S <email address hidden>
Date: Mon Sep 19 11:45:09 2016 +0530

    Fixes KeyError while updating bgp peer

    This will fix the issue of KeyError being thrown when
    'password' is not supplied while updating bgp peer.
    The dict get() method is used to return None when
    'password' key is not available.

    Two unit tests are also added which will test the cases
    1) Exception thrown if the auth type is 'none', and a
    password is supplied when updating
    2) When the password is not supplied

    This was fixed in master on project
    openstack/neutron-dynamic-routing with
    change id- Ief9e88ca12b04eb08b0cc4e60f9d883f1e282ae9

    Since the bug was originally raised for mitaka, the
    original PS mentioned above is being manually
    backported here.

    Change-Id: Ib1f477c6243e5cf92143a21bc86e9759c9de4803
    Closes-Bug: #1616066

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-dynamic-routing 9.0.0.0rc1

This issue was fixed in the openstack/neutron-dynamic-routing 9.0.0.0rc1 release candidate.

tags: removed: mitaka-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 8.3.0

This issue was fixed in the openstack/neutron 8.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-dynamic-routing 9.0.0.0rc1

This issue was fixed in the openstack/neutron-dynamic-routing 9.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 8.3.0

This issue was fixed in the openstack/neutron 8.3.0 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.