KeyError on ls_exp_entries while trying to read/delete a qos config

Bug #1605166 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Fix Committed
High
Sachin Bansal
R3.1
Fix Committed
High
Sachin Bansal

Bug Description

R3.1.0.0 build 2738

While trying to do a GET/DELETE of a qos-config object, getting HTTP Error 500

root@nodec2:~# curl -u admin:contrail123 -X GET http://127.0.0.1:8095/qos-config/547f7b4e-5e85-45b2-99a8-e372dc124a4d
Internal Server Errorroot@nodec2:~#

Cassandra info is this :

>>> for r,c in OBJ_UUID_TABLE.get_range():
... if r=='547f7b4e-5e85-45b2-99a8-e372dc124a4d':
... print r,c
...
547f7b4e-5e85-45b2-99a8-e372dc124a4d OrderedDict([('fq_name', u'["default-global-system-config", "default-global-qos-config", "qos_config_1"]'), ('parent:global_qos_config:9a65a744-927e-417f-92a6-9068ae9ed5d2', u'null'), ('parent_type', u'"global-qos-config"'), ('prop:display_name', u'"qos_config_1"'), ('prop:id_perms', u'{"enable": true, "uuid": {"uuid_mslong": 6088720797751657906, "uuid_lslong": 11072349766348327501}, "creator": null, "created": "2016-07-19T10:29:04.313727", "user_visible": true, "last_modified": "2016-07-19T10:29:04.313727", "permissions": {"owner": "admin", "owner_access": 7, "other_access": 7, "group": "admin", "group_access": 7}, "description": null}'), ('prop:perms2', u'{"owner": "937bf20f654142b284c14b28e1fe72a8", "owner_access": 7, "global_access": 0, "share": []}'), ('prop:qos_config_type', u'"project"'), ('propm:dscp_entries:0', u'{"key": 0, "forwarding_class_id": 10}'), ('propm:mpls_exp_entries:7', u'{"key": 7, "forwarding_class_id": 10}'), ('propm:vlan_priority_entries:0', u'{"key": 0, "forwarding_class_id": 10}'), ('type', u'"qos_config"')])
>>>

----------

ERROR:contrail-api:__default__ [SYS_ERR]: VncApiError: <type 'exceptions.KeyError'>
Python 2.7.6: /usr/bin/python
Tue Jul 19 03:29:04 2016

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_cfg_api_server/vnc_cfg_ifmap.py in _dbe_subscribe_callback(self=<vnc_cfg_api_server.vnc_cfg_ifmap.VncServerKombuClient object>, oper_info={u'imid': u'contrail:qos-config:default-global-system-config:default-global-qos-config:qos_config_1', u'obj_dict': {u'display_name': u'qos_config_1', u'dscp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}, u'fq_name': [u'default-global-system-config', u'default-global-qos-config', u'qos_config_1'], u'id_perms': {u'created': u'2016-07-19T10:29:04.313727', u'creator': None, u'description': None, u'enable': True, u'last_modified': u'2016-07-19T10:29:04.313727', u'permissions': {u'group': u'admin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': {u'uuid_lslong': 11072349766348327501L, u'uuid_mslong': 6088720797751657906}}, u'mpls_exp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 7}]}, u'parent_type': u'global-qos-config', u'perms2': {u'global_access': 0, u'owner': u'937bf20f654142b284c14b28e1fe72a8', u'owner_access': 7, u'share': []}, u'qos_config_type': u'project', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d', u'vlan_priority_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}}, u'oper': u'CREATE', u'parent_imid': u'contrail:global-qos-config:default-global-system-config:default-global-qos-config', u'request-id': u'req-75600df1-8e5a-4de0-b68d-3f1058558012', u'type': u'qos_config', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d'})
 1040
 1041 if oper_info['oper'] == 'CREATE':
 1042 self._dbe_create_notification(oper_info)
 1043 if oper_info['oper'] == 'UPDATE':
 1044 self._dbe_update_notification(oper_info)
self = <vnc_cfg_api_server.vnc_cfg_ifmap.VncServerKombuClient object>
self._dbe_create_notification = <bound method VncServerKombuClient._dbe_create_n...erver.vnc_cfg_ifmap.VncServerKombuClient object>>
oper_info = {u'imid': u'contrail:qos-config:default-global-system-config:default-global-qos-config:qos_config_1', u'obj_dict': {u'display_name': u'qos_config_1', u'dscp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}, u'fq_name': [u'default-global-system-config', u'default-global-qos-config', u'qos_config_1'], u'id_perms': {u'created': u'2016-07-19T10:29:04.313727', u'creator': None, u'description': None, u'enable': True, u'last_modified': u'2016-07-19T10:29:04.313727', u'permissions': {u'group': u'admin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': {u'uuid_lslong': 11072349766348327501L, u'uuid_mslong': 6088720797751657906}}, u'mpls_exp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 7}]}, u'parent_type': u'global-qos-config', u'perms2': {u'global_access': 0, u'owner': u'937bf20f654142b284c14b28e1fe72a8', u'owner_access': 7, u'share': []}, u'qos_config_type': u'project', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d', u'vlan_priority_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}}, u'oper': u'CREATE', u'parent_imid': u'contrail:global-qos-config:default-global-system-config:default-global-qos-config', u'request-id': u'req-75600df1-8e5a-4de0-b68d-3f1058558012', u'type': u'qos_config', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d'}
 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py in _dbe_create_notification(self=<vnc_cfg_api_server.vnc_cfg_ifmap.VncServerKombuClient object>, obj_info={u'imid': u'contrail:qos-config:default-global-system-config:default-global-qos-config:qos_config_1', u'obj_dict': {u'display_name': u'qos_config_1', u'dscp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}, u'fq_name': [u'default-global-system-config', u'default-global-qos-config', u'qos_config_1'], u'id_perms': {u'created': u'2016-07-19T10:29:04.313727', u'creator': None, u'description': None, u'enable': True, u'last_modified': u'2016-07-19T10:29:04.313727', u'permissions': {u'group': u'admin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': {u'uuid_lslong': 11072349766348327501L, u'uuid_mslong': 6088720797751657906}}, u'mpls_exp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 7}]}, u'parent_type': u'global-qos-config', u'perms2': {u'global_access': 0, u'owner': u'937bf20f654142b284c14b28e1fe72a8', u'owner_access': 7, u'share': []}, u'qos_config_type': u'project', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d', u'vlan_priority_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}}, u'oper': u'CREATE', u'parent_imid': u'contrail:global-qos-config:default-global-system-config:default-global-qos-config', u'request-id': u'req-75600df1-8e5a-4de0-b68d-3f1058558012', u'type': u'qos_config', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d'})
 1069 def _dbe_create_notification(self, obj_info):
 1070 try:
 1071 (ok, result) = self._db_client_mgr.dbe_read(obj_info['type'], obj_info)
 1072 if not ok:
 1073 raise Exception(result)
ok undefined
result undefined
self = <vnc_cfg_api_server.vnc_cfg_ifmap.VncServerKombuClient object>
self._db_client_mgr = <vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>
self._db_client_mgr.dbe_read = <bound method VncDbClient.dbe_read of <vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>>
obj_info = {u'imid': u'contrail:qos-config:default-global-system-config:default-global-qos-config:qos_config_1', u'obj_dict': {u'display_name': u'qos_config_1', u'dscp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}, u'fq_name': [u'default-global-system-config', u'default-global-qos-config', u'qos_config_1'], u'id_perms': {u'created': u'2016-07-19T10:29:04.313727', u'creator': None, u'description': None, u'enable': True, u'last_modified': u'2016-07-19T10:29:04.313727', u'permissions': {u'group': u'admin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': {u'uuid_lslong': 11072349766348327501L, u'uuid_mslong': 6088720797751657906}}, u'mpls_exp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 7}]}, u'parent_type': u'global-qos-config', u'perms2': {u'global_access': 0, u'owner': u'937bf20f654142b284c14b28e1fe72a8', u'owner_access': 7, u'share': []}, u'qos_config_type': u'project', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d', u'vlan_priority_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}}, u'oper': u'CREATE', u'parent_imid': u'contrail:global-qos-config:default-global-system-config:default-global-qos-config', u'request-id': u'req-75600df1-8e5a-4de0-b68d-3f1058558012', u'type': u'qos_config', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d'}
/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py in dbe_read(self=<vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>, obj_type=u'qos_config', obj_ids={u'imid': u'contrail:qos-config:default-global-system-config:default-global-qos-config:qos_config_1', u'obj_dict': {u'display_name': u'qos_config_1', u'dscp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}, u'fq_name': [u'default-global-system-config', u'default-global-qos-config', u'qos_config_1'], u'id_perms': {u'created': u'2016-07-19T10:29:04.313727', u'creator': None, u'description': None, u'enable': True, u'last_modified': u'2016-07-19T10:29:04.313727', u'permissions': {u'group': u'admin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': {u'uuid_lslong': 11072349766348327501L, u'uuid_mslong': 6088720797751657906}}, u'mpls_exp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 7}]}, u'parent_type': u'global-qos-config', u'perms2': {u'global_access': 0, u'owner': u'937bf20f654142b284c14b28e1fe72a8', u'owner_access': 7, u'share': []}, u'qos_config_type': u'project', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d', u'vlan_priority_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}}, u'oper': u'CREATE', u'parent_imid': u'contrail:global-qos-config:default-global-system-config:default-global-qos-config', u'request-id': u'req-75600df1-8e5a-4de0-b68d-3f1058558012', u'type': u'qos_config', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d'}, obj_fields=None)
 1850 try:
 1851 (ok, cassandra_result) = self._cassandra_db.object_read(
 1852 obj_type, [obj_ids['uuid']], obj_fields)
 1853 except NoIdError as e:
 1854 # if NoIdError is for obj itself (as opposed to say for parent
obj_type = u'qos_config'
obj_ids = {u'imid': u'contrail:qos-config:default-global-system-config:default-global-qos-config:qos_config_1', u'obj_dict': {u'display_name': u'qos_config_1', u'dscp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}, u'fq_name': [u'default-global-system-config', u'default-global-qos-config', u'qos_config_1'], u'id_perms': {u'created': u'2016-07-19T10:29:04.313727', u'creator': None, u'description': None, u'enable': True, u'last_modified': u'2016-07-19T10:29:04.313727', u'permissions': {u'group': u'admin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': {u'uuid_lslong': 11072349766348327501L, u'uuid_mslong': 6088720797751657906}}, u'mpls_exp_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 7}]}, u'parent_type': u'global-qos-config', u'perms2': {u'global_access': 0, u'owner': u'937bf20f654142b284c14b28e1fe72a8', u'owner_access': 7, u'share': []}, u'qos_config_type': u'project', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d', u'vlan_priority_entries': {u'qos_id_forwarding_class_pair': [{u'forwarding_class_id': 10, u'key': 0}]}}, u'oper': u'CREATE', u'parent_imid': u'contrail:global-qos-config:default-global-system-config:default-global-qos-config', u'request-id': u'req-75600df1-8e5a-4de0-b68d-3f1058558012', u'type': u'qos_config', u'uuid': u'547f7b4e-5e85-45b2-99a8-e372dc124a4d'}

 /usr/lib/python2.7/dist-packages/cfgm_common/vnc_cassandra.py in object_read(self=<vnc_cfg_api_server.vnc_cfg_ifmap.VncServerCassandraClient object>, obj_type=u'qos_config', obj_uuids=[u'547f7b4e-5e85-45b2-99a8-e372dc124a4d'], field_names=None)
  697 if self._re_match_prop_map.match(col_name):
  698 prop_name, _, _ = col_name.strip('propm:').partition(':')
  699 if obj_class.prop_map_field_has_wrappers[prop_name]:
  700 prop_field_types = obj_class.prop_field_types[prop_name]
  701 wrapper_type = prop_field_types['xsd_type']
obj_class = <class 'vnc_cfg_api_server.vnc_cfg_api_server.QosConfigServer'>
obj_class.prop_map_field_has_wrappers = {'dscp_entries': True, 'mpls_exp_entries': True, 'vlan_priority_entries': True}
prop_name = 'ls_exp_entries'
<type 'exceptions.KeyError'>: 'ls_exp_entries'
    __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>
    __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 = ('ls_exp_entries',)
    message = 'ls_exp_entries'

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_cfg_api_server/vnc_cfg_ifmap.py", line 1042, in _dbe_subscribe_callback
    self._dbe_create_notification(oper_info)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py", line 1071, in _dbe_create_notification
    (ok, result) = self._db_client_mgr.dbe_read(obj_info['type'], obj_info)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py", line 1852, in dbe_read
    obj_type, [obj_ids['uuid']], obj_fields)
  File "/usr/lib/python2.7/dist-packages/cfgm_common/vnc_cassandra.py", line 699, in object_read
    if obj_class.prop_map_field_has_wrappers[prop_name]:
KeyError: 'ls_exp_entries'

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 856, in _handle
    return route.call(**args)
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 1721, in wrapper
    rv = callback(*a, **ka)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 1602, in handler_trap_exception
    response = handler(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/cfgm_common/vnc_api_stats.py", line 17, in wrapper
    response = func(api_server_obj, resource_type, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 609, in http_resource_read
    obj_fields)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py", line 1852, in dbe_read
    obj_type, [obj_ids['uuid']], obj_fields)
  File "/usr/lib/python2.7/dist-packages/cfgm_common/vnc_cassandra.py", line 699, in object_read
    if obj_class.prop_map_field_has_wrappers[prop_name]:
KeyError: 'ls_exp_entries'

Tags: config qos
Revision history for this message
Naveen N (naveenn) wrote :

If a property name starts with m or p or r and its of type map,
we hit this issue. strip() matches for all the characters passed in it
and hence the property name is calculated wrong

Changed in juniperopenstack:
assignee: Naveen N (naveenn) → Sachin Bansal (sbansal)
Revision history for this message
Sachin Bansal (sbansal) wrote :

Fix committed with commit id 10c96256a83c61ff15790afb6cbda8dc326a9a56 in controller repo.

Changed in juniperopenstack:
status: New → Fix Committed
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.