fail to create ha router due to port-security

Bug #1468588 reported by yong sheng gong
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Committed
Undecided
yong sheng gong

Bug Description

when create a ha router, it complains an internal error.
examine the q-svc log, it reads:
2015-06-25 10:03:27.092 ERROR neutron.api.v2.resource [req-2a48e4d2-52a8-421e-a99b-c3cb305fc8cc admin demo] create failed
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource Traceback (most recent call last):
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource result = method(request=request, **args)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/api/v2/base.py", line 462, in create
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource obj = obj_creator(request.context, **kwargs)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/db/l3_hamode_db.py", line 374, in create_router
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource self.delete_router(context, router_dict['id'])
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 119, in __exit__
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/db/l3_hamode_db.py", line 370, in create_router
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource self._create_ha_interfaces(context, router_db, ha_network)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/db/l3_hamode_db.py", line 326, in _create_ha_interfaces
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource l3_port_check=False)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 119, in __exit__
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/db/l3_hamode_db.py", line 320, in _create_ha_interfaces
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource router.tenant_id)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/db/l3_hamode_db.py", line 301, in add_ha_port
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource 'name': constants.HA_PORT_NAME % tenant_id}})
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 998, in create_port
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource result, mech_context = self._create_port_db(context, port)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 980, in _create_port_db
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource network = self.get_network(context, result['network_id'])
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 665, in get_network
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource result = super(Ml2Plugin, self).get_network(context, id, None)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 285, in get_network
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource return self._make_network_dict(network, fields)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/db/db_base_plugin_common.py", line 238, in _make_network_dict
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource attributes.NETWORKS, res, network)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/db/common_db_mixin.py", line 178, in _apply_dict_extend_functions
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource func(*args)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 484, in _ml2_md_extend_network_dict
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource self.extension_manager.extend_network_dict(session, netdb, result)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/plugins/ml2/managers.py", line 805, in extend_network_dict
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource driver.obj.extend_network_dict(session, base_model, result)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/plugins/ml2/extensions/port_security.py", line 60, in extend_network_dict
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource self._extend_port_security_dict(result, db_data)
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource File "/mnt/data3/opt/stack/neutron/neutron/plugins/ml2/extensions/port_security.py", line 67, in _extend_port_security_dict
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource db_data['port_security'][psec.PORTSECURITY])
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource TypeError: 'NoneType' object has no attribute '__getitem__'
2015-06-25 10:03:27.092 14237 ERROR neutron.api.v2.resource

Changed in neutron:
assignee: nobody → yong sheng gong (gongysh)
Changed in neutron:
status: New → In Progress
Revision history for this message
yong sheng gong (gongysh) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/188209
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f4e1289d8d381b775f7a6e5f98c507a99fd42b54
Submitter: Jenkins
Branch: master

commit f4e1289d8d381b775f7a6e5f98c507a99fd42b54
Author: Kahou Lei <email address hidden>
Date: Wed Jun 3 16:39:11 2015 -0700

    populate port security default into network

    Previously, the default value would be populated into attr by API
    controller, but some codes in plugin or service plugins call plugin
    to create network directly, such as l3, which will have no default
    value populated.
    This patch fixes it by populating default port_security value into
    network data.

    In addition, for network without port-security set, we also give the
    default value to populate the return network dict object, which will
    let the extension construct the response dictionary gracefully for
    those existing network.

    Co-Authored-By: gong yong sheng <gong.yongsheng@99cloud.net>

    Change-Id: I73abc98d83372f6259f17680806e6541458e2077
    Closes-bug: #1461519
    Closes-Bug: #1461647
    Closes-Bug: #1468588

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

Fix proposed to branch: feature/pecan
Review: https://review.openstack.org/207903

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (feature/pecan)
Download full text (70.7 KiB)

Reviewed: https://review.openstack.org/207903
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=9badcd249dab2d3330f0cd608496b59c9f44499a
Submitter: Jenkins
Branch: feature/pecan

commit 991ea00e6c115343eabecc62e86072175823f81f
Author: Moshe Levi <email address hidden>
Date: Thu Jul 30 12:04:15 2015 +0300

    SR-IOV: Fix SR-IOV agent to run ip link commands as root

    Commit https://review.openstack.org/#/c/155523/
    remove the remaining root_helper args, but didn't
    update the SR-IOV agent to execute them as root.

    This patch updates the agent to execute ip link commands
    as root and pass options argument as a list in the
    self._as_root method.

    Closes-Bug: #1479694
    Change-Id: I53cafd61845a69fae3a759fb7526950d655ffa20

commit 5b3bacedf6c014815bef03c2e821b5eb8ef92dcb
Author: Saksham Varma <email address hidden>
Date: Thu Jul 23 22:46:23 2015 -0700

    Moved out cisco n1kv mech driver and db models

    Moving out Cisco N1Kv database models and the mech driver
    to the openstack/networking-cisco repo as part of the second
    phase vendor-core decomposition

    Partial-Bug: #1479123
    Partial-implements: blueprint core-vendor-decomposition

    Change-Id: I65a704b238d8cbe2951a6912fa4f1e8518c6f412

commit 65ac8cd0a80548e115b8ec1d4cfd47a94422fddf
Author: OpenStack Proposal Bot <email address hidden>
Date: Wed Jul 29 20:44:01 2015 +0000

    Updated from global requirements

    Change-Id: I3a884a73d51df0f93b5cc88b3e3250d81bb1f455

commit f0e8356d04d04600c072a1c0f0bdf274ff19ab8c
Author: sridhargaddam <email address hidden>
Date: Mon Jul 27 03:46:48 2015 +0000

    Update dhcp agent cache for network:dhcp ports

    When a network with a dhcp_enabled subnet is scheduled on a dhcp
    agent, dhcp driver creates the network:dhcp port for the subnet.
    However, the port info is not updated in dhcp agents internal cache.
    Subsequently if the user deletes the network:dhcp port, the port is
    properly deleted on the server side (i.e., in the database) and when
    the port_delete_end notification is sent to the dhcp agent, it simply
    ignores it as the port entry would be missing in the cache. This patch
    fixes this issue by updating the dhcp agents cache when dhcp driver
    creates the network:dhcp port for the subnets.

    Closes-Bug: #1478426
    Change-Id: I69f5834dd964a4320c606c4e0aa2cdba70416943

commit cb60d0bb4e0cc0cba68f59fdf5f4e89d6ec52950
Author: changzhi <email address hidden>
Date: Thu Jul 16 10:14:16 2015 +0800

    Keep dns nameserver order consistency

    Currently, there is no dns servers prioritization for subnets
    for Neutron.

    Generally speaking, it is useful to keep the order of dns
    nameservers consistent. Add a new column named 'order' in table
    'dnsnameservers' and add nameserver into DB one by one.

    Closes-Bug: #1218629
    Implements: blueprint keep-dns-nameserver-orderconsistency
    Change-Id: Id937aea411397d39370368a4eb45be26c4eefa9e

commit b39e1469e824bc8bc79e1ecafa98825a94811c0b
Author: Salvatore Orlando <email address hidden>
Date: Tue Jun 23 04:54:2...

tags: added: in-feature-pecan
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by gongysh (gong.yongsheng@99cloud.net) on branch: master
Review: https://review.openstack.org/195405

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

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/228742

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

Reviewed: https://review.openstack.org/228742
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=23944185af7ef4ec54a7e18b7a1c38a636b6b883
Submitter: Jenkins
Branch: stable/kilo

commit 23944185af7ef4ec54a7e18b7a1c38a636b6b883
Author: Kahou Lei <email address hidden>
Date: Wed Jun 3 16:39:11 2015 -0700

    populate port security default into network

    Previously, the default value would be populated into attr by API
    controller, but some codes in plugin or service plugins call plugin
    to create network directly, such as l3, which will have no default
    value populated.
    This patch fixes it by populating default port_security value into
    network data.

    In addition, for network without port-security set, we also give the
    default value to populate the return network dict object, which will
    let the extension construct the response dictionary gracefully for
    those existing network.

    Co-Authored-By: gong yong sheng <gong.yongsheng@99cloud.net>

    Change-Id: I73abc98d83372f6259f17680806e6541458e2077
    Closes-bug: #1461519
    Closes-Bug: #1461647
    Closes-Bug: #1468588
    (cherry picked from commit f4e1289d8d381b775f7a6e5f98c507a99fd42b54)

tags: added: in-stable-kilo
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.