Update on a port with fixed_ips attribute (subnet_id, ip_address) failed with internal server error

Bug #1358212 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R1.1
Fix Committed
Medium
Sachin Bansal
Trunk
Fix Committed
Medium
Sachin Bansal

Bug Description

Build 1.10 16

Port Update request {'port': {'fixed_ips': [{'subnet_id': u'ce670450-a9bc-4c2e-99de-a59de2e6d6b5', 'ip_address': '7.25.179.160'}]}}

contrail-api.log :

<type 'exceptions.KeyError'>
Python 2.7.3: /usr/bin/python
Sun Aug 17 21:47:47 2014

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py in plugin_update_port(self=<vnc_openstack.neutron_plugin_interface.NeutronPluginInterface object>, context={u'is_admin': True, u'operation': u'UPDATE', u'roles': [u'KeystoneAdmin', u'admin', u'KeystoneServiceAdmin'], u'tenant': u'f73ca22c5af44590bfd38478f998426a', u'tenant_id': u'f73ca22c5af44590bfd38478f998426a', u'type': u'port', u'user_id': u'ab7a0af5dda6434cbc917ce50b79807e'}, port={u'fields': None, u'filters': None, u'id': u'19e9b6fb-a06e-44ce-9ac9-12079f969483', u'resource': {u'fixed_ips': [{u'ip_address': u'7.25.179.160', u'subnet_id': u'ce670450-a9bc-4c2e-99de-a59de2e6d6b5'}], 'id': u'19e9b6fb-a06e-44ce-9ac9-12079f969483'}})
  387 cfgdb = self._get_user_cfgdb(context)
  388 net_info = cfgdb.port_update(port['id'],
  389 port['resource'])
  390 return net_info
  391 except Exception as e:
port = {u'fields': None, u'filters': None, u'id': u'19e9b6fb-a06e-44ce-9ac9-12079f969483', u'resource': {u'fixed_ips': [{u'ip_address': u'7.25.179.160', u'subnet_id': u'ce670450-a9bc-4c2e-99de-a59de2e6d6b5'}], 'id': u'19e9b6fb-a06e-44ce-9ac9-12079f969483'}}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in port_update(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, port_id=u'19e9b6fb-a06e-44ce-9ac9-12079f969483', port_q={u'fixed_ips': [{u'ip_address': u'7.25.179.160', u'subnet_id': u'ce670450-a9bc-4c2e-99de-a59de2e6d6b5'}], 'id': u'19e9b6fb-a06e-44ce-9ac9-12079f969483'})
 3449 req_ip_subnets = []
 3450 port_q['id'] = port_id
 3451 port_obj = self._port_neutron_to_vnc(port_q, None, UPDATE)
 3452 net_id = port_obj.get_virtual_network_refs()[0]['uuid']
 3453 net_obj = self._network_read(net_id)
port_obj undefined
self = <vnc_openstack.neutron_plugin_db.DBInterface object>
self._port_neutron_to_vnc = <bound method DBInterface._port_neutron_to_vnc o..._openstack.neutron_plugin_db.DBInterface object>>
port_q = {u'fixed_ips': [{u'ip_address': u'7.25.179.160', u'subnet_id': u'ce670450-a9bc-4c2e-99de-a59de2e6d6b5'}], 'id': u'19e9b6fb-a06e-44ce-9ac9-12079f969483'}
builtinNone = None
global UPDATE = 3

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in _port_neutron_to_vnc(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, port_q={u'fixed_ips': [{u'ip_address': u'7.25.179.160', u'subnet_id': u'ce670450-a9bc-4c2e-99de-a59de2e6d6b5'}], 'id': u'19e9b6fb-a06e-44ce-9ac9-12079f969483'}, net_obj=None, oper=3)
 2067
 2068 if 'fixed_ips' in port_q:
 2069 net_id = port_q['network_id']
 2070 for fixed_ip in port_q.get('fixed_ips', []):
 2071 if 'ip_address' in fixed_ip:
net_id undefined
port_q = {u'fixed_ips': [{u'ip_address': u'7.25.179.160', u'subnet_id': u'ce670450-a9bc-4c2e-99de-a59de2e6d6b5'}], 'id': u'19e9b6fb-a06e-44ce-9ac9-12079f969483'}
<type 'exceptions.KeyError'>: 'network_id'
    __class__ = <type 'exceptions.KeyError'>
    __delattr__ = <method-wrapper '__delattr__' of exceptions.KeyError object>
    __dict__ = {}
    __doc__ = 'Mapping key not found.'
    __format__ = <built-in method __format__ of exceptions.KeyError object>
    __getattribute__ = <method-wrapper '__getattribute__' of exceptions.KeyError object>
    __getitem__ = <method-wrapper '__getitem__' of exceptions.KeyError object>
    __getslice__ = <method-wrapper '__getslice__' of exceptions.KeyError object>
    __hash__ = <method-wrapper '__hash__' of exceptions.KeyError object>
    __init__ = <method-wrapper '__init__' of exceptions.KeyError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of exceptions.KeyError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of exceptions.KeyError object>
    __repr__ = <method-wrapper '__repr__' of exceptions.KeyError object>
    __setattr__ = <method-wrapper '__setattr__' of exceptions.KeyError object>
    __setstate__ = <built-in method __setstate__ of exceptions.KeyError object>
    __sizeof__ = <built-in method __sizeof__ of exceptions.KeyError object>
    __str__ = <method-wrapper '__str__' of exceptions.KeyError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of exceptions.KeyError object>
    args = ('network_id',)
    message = 'network_id'

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 389, in plugin_update_port
    port['resource'])
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 3451, in port_update
    port_obj = self._port_neutron_to_vnc(port_q, None, UPDATE)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 2069, in _port_neutron_to_vnc
    net_id = port_q['network_id']
KeyError: 'network_id'

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 764, in _handle
    return route.call(**args)
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 1575, in wrapper
    rv = callback(*a, **ka)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 452, in plugin_http_post_port
    return self.plugin_update_port(context, port)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 393, in plugin_update_port
    raise e
KeyError: 'network_id'
10.204.217.7 - - [2014-08-17 21:47:47] "POST /neutron/port HTTP/1.1" 500 156 0.011835

Sachin Bansal (sbansal)
Changed in juniperopenstack:
status: New → In Progress
Revision history for this message
Sachin Bansal (sbansal) wrote :
Changed in juniperopenstack:
status: In Progress → Fix Committed
Revision history for this message
Nagabhushana R (bhushana) wrote :

please check for 1.1 commit and update

Changed in juniperopenstack:
milestone: r1.10-fcs → none
Revision history for this message
Sachin Bansal (sbansal) wrote :
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.