Error 500 while updating QosConfig object

Bug #1603195 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.1
Fix Committed
Medium
Ranjeet R
Trunk
Fix Committed
Medium
Ranjeet R

Bug Description

R3.1.0.0 Build 2738

Happens when dscp/dot1p/exp entries are set to None whiel updating

Below qos_fixture2.qos_config_obj is a QosConfig object

(Pdb) qos_fixture2.qos_config_obj.set_mpls_exp_entries(None)
(Pdb) qos_fixture2.vnc_api_h.qos_config_update(qos_fixture2.qos_config_obj)
*** HttpError: HTTP Status: 500 Content: <type 'exceptions.AttributeError'>
Python 2.7.6: /usr/bin/python
Thu Jul 14 12:19:30 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_api_server.py in http_resource_update(self=<vnc_cfg_api_server.vnc_cfg_api_server.VncApiServer object>, obj_type='qos_config', id='2e1297b9-c62e-41b8-a964-413a7c62f4c0')
  742
  743 try:
  744 ok, result = stateful_update()
  745 except Exception as e:
  746 ok = False
ok = False
result = 'RWX'
stateful_update = <function stateful_update>

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py in stateful_update()
  728 get_context().set_state('DBE_UPDATE')
  729 (ok, result) = db_conn.dbe_update(obj_type, obj_ids,
  730 obj_dict)
  731 if not ok:
  732 return (ok, result)
obj_dict = {'mpls_exp_entries': None, 'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py in wrapper2(self=<vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>, obj_type='qos_config', obj_ids={'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}, obj_dict={'mpls_exp_entries': None, 'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'})
 1757 obj_ids, obj_dict)
 1758 try:
 1759 ret = func(self, obj_type, obj_ids, obj_dict)
 1760 trace_msg(trace, 'DBRequestTraceBuf',
 1761 self._sandesh)
ret undefined
func = <function wrapper2>
self = <vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>
obj_type = 'qos_config'
obj_ids = {'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}
obj_dict = {'mpls_exp_entries': None, 'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py in wrapper2(self=<vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>, obj_type='qos_config', obj_ids={'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}, obj_dict={'mpls_exp_entries': None, 'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'})
 1789
 1790 # don't build sharing indexes if operation (create/update) failed
 1791 (ok, result) = func(self, obj_type, obj_ids, obj_dict)
 1792 if not ok:
 1793 return (ok, result)
ok undefined
result undefined
func = <function dbe_update>
self = <vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>
obj_type = 'qos_config'
obj_ids = {'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}
obj_dict = {'mpls_exp_entries': None, 'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py in dbe_update(self=<vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>, obj_type='qos_config', obj_ids={'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}, new_obj_dict={'mpls_exp_entries': None, 'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'})
 1903 def dbe_update(self, obj_type, obj_ids, new_obj_dict):
 1904 (ok, cassandra_result) = self._cassandra_db.object_update(
 1905 obj_type, obj_ids['uuid'], new_obj_dict)
 1906
 1907 # publish to ifmap via message bus (rabbitmq)
obj_type = 'qos_config'
obj_ids = {'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}
new_obj_dict = {'mpls_exp_entries': None, 'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}

 /usr/lib/python2.7/dist-packages/cfgm_common/vnc_cassandra.py in object_update(self=<vnc_cfg_api_server.vnc_cfg_ifmap.VncServerCassandraClient object>, obj_type='qos_config', obj_uuid='2e1297b9-c62e-41b8-a964-413a7c62f4c0', new_obj_dict={'mpls_exp_entries': None, 'uuid': '2e1297b9-c62e-41b8-a964-413a7c62f4c0'}, uuid_batch=None)
  903 # wrapper on read
  904 if obj_class.prop_map_field_has_wrappers[prop_name]:
  905 wrapper_field = new_props[prop_name].keys()[0]
  906 map_coll = new_props[prop_name][wrapper_field]
  907 else:
wrapper_field undefined
new_props = {u'mpls_exp_entries': None}
prop_name = u'mpls_exp_entries'
].keys undefined
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'keys'
    __class__ = <type 'exceptions.AttributeError'>
    __delattr__ = <method-wrapper '__delattr__' of exceptions.AttributeError object>
    __dict__ = {}
    __doc__ = 'Attribute not found.'
    __format__ = <built-in method __format__ of exceptions.AttributeError object>
    __getattribute__ = <method-wrapper '__getattribute__' of exceptions.AttributeError object>
    __getitem__ = <method-wrapper '__getitem__' of exceptions.AttributeError object>
    __getslice__ = <method-wrapper '__getslice__' of exceptions.AttributeError object>
    __hash__ = <method-wrapper '__hash__' of exceptions.AttributeError object>
    __init__ = <method-wrapper '__init__' of exceptions.AttributeError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of exceptions.AttributeError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of exceptions.AttributeError object>
    __repr__ = <method-wrapper '__repr__' of exceptions.AttributeError object>
    __setattr__ = <method-wrapper '__setattr__' of exceptions.AttributeError object>
    __setstate__ = <built-in method __setstate__ of exceptions.AttributeError object>
    __sizeof__ = <built-in method __sizeof__ of exceptions.AttributeError object>
    __str__ = <method-wrapper '__str__' of exceptions.AttributeError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of exceptions.AttributeError object>
    args = ("'NoneType' object has no attribute 'keys'",)
    message = "'NoneType' object has no attribute 'keys'"

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_api_server.py", line 744, in http_resource_update
    ok, result = stateful_update()
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 730, in stateful_update
    obj_dict)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py", line 1759, in wrapper2
    ret = func(self, obj_type, obj_ids, obj_dict)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py", line 1791, in wrapper2
    (ok, result) = func(self, obj_type, obj_ids, obj_dict)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_ifmap.py", line 1905, in dbe_update
    obj_type, obj_ids['uuid'], new_obj_dict)
  File "/usr/lib/python2.7/dist-packages/cfgm_common/vnc_cassandra.py", line 905, in object_update
    wrapper_field = new_props[prop_name].keys()[0]
AttributeError: 'NoneType' object has no attribute 'keys'

Tags: config qos
summary: - InternalServerError while updating QosConfig object
+ Error 500 while updating QosConfig object
Sachin Bansal (sbansal)
Changed in juniperopenstack:
assignee: Sachin Bansal (sbansal) → Ranjeet R (rranjeet-n)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/22054
Submitter: Ranjeet R (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.1

Review in progress for https://review.opencontrail.org/22055
Submitter: Ranjeet R (<email address hidden>)

Jeba Paulaiyan (jebap)
tags: added: qos
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/22055
Committed: http://github.org/Juniper/contrail-controller/commit/2750f28774f6bf6f74b42ab6207dcef1842ad532
Submitter: Zuul
Branch: R3.1

commit 2750f28774f6bf6f74b42ab6207dcef1842ad532
Author: Ranjeet R <email address hidden>
Date: Fri Jul 15 11:56:29 2016 -0700

Fixes: Error 500 while updating QosConfig object

When updating a Map or a List property check if it is not None
before indexing for the first element.

Change-Id: Ie511ea7e7c26a26ffb3aca0e7ddd3a0d16058c37
Closes-Bug: 1603195

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/22054
Committed: http://github.org/Juniper/contrail-controller/commit/1e0e6db2f4408e4774337928fa03e49cb03dedf9
Submitter: Zuul
Branch: master

commit 1e0e6db2f4408e4774337928fa03e49cb03dedf9
Author: Ranjeet R <email address hidden>
Date: Fri Jul 15 11:46:26 2016 -0700

Fixes: Error 500 while updating QosConfig object

When updating a Map or a List property check if it is not None
before indexing for the first element.

Change-Id: Ib824340d283b20e39bfe3df34d59481a1806ecf6
Closes-Bug: 1603195

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.