Schema crashing due to routing-policy config upon upgrade to 2722

Bug #1551049 reported by amit surana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.0
Fix Committed
Critical
Sachin Bansal
Trunk
Fix Committed
Critical
Sachin Bansal

Bug Description

config node: 10.87.26.145

Schema is crashing with below traceback:

02/28/2016 04:53:37 PM [contrail-schema]: SANDESH: CONNECT TO COLLECTOR: True
02/28/2016 04:53:37 PM [contrail-schema]: SANDESH: Logging: LEVEL: [SYS_INFO] -> [SYS_DEBUG]
02/28/2016 04:53:37 PM [contrail-schema]: SANDESH: Logging: FILE: [None] -> [/var/log/contrail/contrail-schema.log]
<type 'exceptions.TypeError'>
Python 2.7.6: /usr/bin/python
Sun Feb 28 16:53:39 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/bin/contrail-schema in <module>()
    6
    7 if __name__ == '__main__':
    8 sys.exit(
    9 load_entry_point('schema-transformer==0.1dev', 'console_scripts', 'contrail-schema')()
   10 )
load_entry_point = <function load_entry_point>

 /usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py in server_main()
  829 def server_main():
  830 cgitb.enable(format='text')
  831 main()
  832 # end server_main
  833
global main = <function main>

 /usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py in main(args_str='--conf_file /etc/contrail/contrail-schema.conf -... --conf_file /etc/contrail/contrail-database.conf')
  823 _zookeeper_client.master_election(zk_path_pfx + "/schema-transformer",
  824 os.getpid(), run_schema_transformer,
  825 args)
  826 # end main
  827
args = Namespace(admin_password='contrail123', admin_te...7:2181,172.16.180.8:2181', zk_server_port='2181')

 /usr/lib/python2.7/dist-packages/cfgm_common/zkclient.py in master_election(self=<cfgm_common.zkclient.ZookeeperClient object>, path='/schema-transformer', identifier=32178, func=<function run_schema_transformer>, *args=(Namespace(admin_password='contrail123', admin_te...7:2181,172.16.180.8:2181', zk_server_port='2181'),), **kwargs={})
  334 def master_election(self, path, identifier, func, *args, **kwargs):
  335 self._election = self._zk_client.Election(path, identifier)
  336 self._election.run(func, *args, **kwargs)
  337 # end master_election
  338
self = <cfgm_common.zkclient.ZookeeperClient object>
self._election = <kazoo.recipe.election.Election object>
self._election.run = <bound method Election.run of <kazoo.recipe.election.Election object>>
func = <function run_schema_transformer>
args = (Namespace(admin_password='contrail123', admin_te...7:2181,172.16.180.8:2181', zk_server_port='2181'),)
kwargs = {}

 /usr/lib/python2.7/dist-packages/kazoo/recipe/election.py in run(self=<kazoo.recipe.election.Election object>, func=<function run_schema_transformer>, *args=(Namespace(admin_password='contrail123', admin_te...7:2181,172.16.180.8:2181', zk_server_port='2181'),), **kwargs={})
   46 try:
   47 with self.lock:
   48 func(*args, **kwargs)
   49
   50 except CancelledError:
func = <function run_schema_transformer>
args = (Namespace(admin_password='contrail123', admin_te...7:2181,172.16.180.8:2181', zk_server_port='2181'),)
kwargs = {}

 /usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py in run_schema_transformer(args=Namespace(admin_password='contrail123', admin_te...7:2181,172.16.180.8:2181', zk_server_port='2181'))
  804
  805 global transformer
  806 transformer = SchemaTransformer(args)
  807 gevent.joinall(transformer._vnc_kombu.greenlets())
  808 # end run_schema_transformer
global transformer = None
global SchemaTransformer = <class 'schema_transformer.to_bgp.SchemaTransformer'>
args = Namespace(admin_password='contrail123', admin_te...7:2181,172.16.180.8:2181', zk_server_port='2181')

 /usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py in __init__(self=<schema_transformer.to_bgp.SchemaTransformer object>, args=Namespace(admin_password='contrail123', admin_te...7:2181,172.16.180.8:2181', zk_server_port='2181'))
  211 DBBaseST._vnc_lib = _vnc_lib
  212 ServiceChain.init()
  213 self.reinit()
  214 # create cpu_info object to send periodic updates
  215 sysinfo_req = False
self = <schema_transformer.to_bgp.SchemaTransformer object>
self.reinit = <bound method SchemaTransformer.reinit of <schema_transformer.to_bgp.SchemaTransformer object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py in reinit(self=<schema_transformer.to_bgp.SchemaTransformer object>)
  453
  454 gevent.sleep(0.001)
  455 RoutingPolicyST.reinit()
  456 gevent.sleep(0.001)
  457 RouteAggregateST.reinit()
global RoutingPolicyST = <class 'schema_transformer.config_db.RoutingPolicyST'>
RoutingPolicyST.reinit = <bound method __metaclass__.reinit of <class 'schema_transformer.config_db.RoutingPolicyST'>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in reinit(cls=<class 'schema_transformer.config_db.RoutingPolicyST'>)
   97 def reinit(cls):
   98 for obj in cls.list_vnc_obj():
   99 cls.locate(obj.get_fq_name_str(), obj)
  100 # reinit
  101
cls = <class 'schema_transformer.config_db.RoutingPolicyST'>
cls.locate = <bound method __metaclass__.locate of <class 'schema_transformer.config_db.RoutingPolicyST'>>
obj = <vnc_api.gen.resource_client.RoutingPolicy object>
obj.get_fq_name_str = <bound method RoutingPolicy.get_fq_name_str of <vnc_api.gen.resource_client.RoutingPolicy object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in locate(cls=<class 'schema_transformer.config_db.RoutingPolicyST'>, key=u'default-domain:bgp-test:Full-1', *args=(<vnc_api.gen.resource_client.RoutingPolicy object>,))
  102 @classmethod
  103 def locate(cls, key, *args):
  104 obj = super(DBBaseST, cls).locate(key, *args)
  105 if obj.obj.uuid not in cls._uuid_fq_name_map:
  106 cls._uuid_fq_name_map[obj.obj.uuid] = key
obj undefined
builtinsuper = <type 'super'>
global DBBaseST = <class 'schema_transformer.config_db.DBBaseST'>
cls = <class 'schema_transformer.config_db.RoutingPolicyST'>
).locate = <bound method __metaclass__.locate of <class 'schema_transformer.config_db.RoutingPolicyST'>>
key = u'default-domain:bgp-test:Full-1'
args = (<vnc_api.gen.resource_client.RoutingPolicy object>,)

 /usr/lib/python2.7/dist-packages/cfgm_common/vnc_db.py in locate(cls=<class 'schema_transformer.config_db.RoutingPolicyST'>, key=u'default-domain:bgp-test:Full-1', *args=(<vnc_api.gen.resource_client.RoutingPolicy object>,))
   62 if key not in cls._dict:
   63 try:
   64 obj = cls(key, *args)
   65 cls._dict[key] = obj
   66 return obj
obj undefined
cls = <class 'schema_transformer.config_db.RoutingPolicyST'>
key = u'default-domain:bgp-test:Full-1'
args = (<vnc_api.gen.resource_client.RoutingPolicy object>,)

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in __init__(self=<schema_transformer.config_db.RoutingPolicyST object>, name=u'default-domain:bgp-test:Full-1', obj=<vnc_api.gen.resource_client.RoutingPolicy object>)
 3836 ri = RoutingInstanceST.get(ri_name)
 3837 if ri:
 3838 ri.routing_policys[self.name] = ref['attr']['sequence']
 3839 # end __init__
 3840
ri = <schema_transformer.config_db.RoutingInstanceST object>
ri.routing_policys = {u'default-domain:bgp-test:Full': u'1', u'default-domain:bgp-test:Full-1': u'2'}
self = <schema_transformer.config_db.RoutingPolicyST object>
self.name = u'default-domain:bgp-test:Full-1'
ref = {'attr': <vnc_api.gen.resource_xsd.RoutingPolicyType object>, 'href': '', 'to': [u'default-domain', u'bgp-test', u'vn29', u'service-a96d2725-8a75-431a-8cbb-1f1e9b59e599-default-domain_bgp-test_SC-RA'], 'uuid': '20e760ab-b2e5-4651-8189-ecb199f5ee1b'}
<type 'exceptions.TypeError'>: 'RoutingPolicyType' object has no attribute '__getitem__'
    __class__ = <type 'exceptions.TypeError'>
    __delattr__ = <method-wrapper '__delattr__' of exceptions.TypeError object>
    __dict__ = {}
    __doc__ = 'Inappropriate argument type.'
    __format__ = <built-in method __format__ of exceptions.TypeError object>
    __getattribute__ = <method-wrapper '__getattribute__' of exceptions.TypeError object>
    __getitem__ = <method-wrapper '__getitem__' of exceptions.TypeError object>
    __getslice__ = <method-wrapper '__getslice__' of exceptions.TypeError object>
    __hash__ = <method-wrapper '__hash__' of exceptions.TypeError object>
    __init__ = <method-wrapper '__init__' of exceptions.TypeError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of exceptions.TypeError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of exceptions.TypeError object>
    __repr__ = <method-wrapper '__repr__' of exceptions.TypeError object>
    __setattr__ = <method-wrapper '__setattr__' of exceptions.TypeError object>
    __setstate__ = <built-in method __setstate__ of exceptions.TypeError object>
    __sizeof__ = <built-in method __sizeof__ of exceptions.TypeError object>
    __str__ = <method-wrapper '__str__' of exceptions.TypeError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of exceptions.TypeError object>
    args = ("'RoutingPolicyType' object has no attribute '__getitem__'",)
    message = "'RoutingPolicyType' object has no attribute '__getitem__'"

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

Traceback (most recent call last):
  File "/usr/bin/contrail-schema", line 9, in <module>
    load_entry_point('schema-transformer==0.1dev', 'console_scripts', 'contrail-schema')()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 831, in server_main
    main()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 825, in main
    args)
  File "/usr/lib/python2.7/dist-packages/cfgm_common/zkclient.py", line 336, in master_election
    self._election.run(func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/kazoo/recipe/election.py", line 48, in run
    func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 806, in run_schema_transformer
    transformer = SchemaTransformer(args)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 213, in __init__
    self.reinit()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 455, in reinit
    RoutingPolicyST.reinit()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 99, in reinit
    cls.locate(obj.get_fq_name_str(), obj)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 104, in locate
    obj = super(DBBaseST, cls).locate(key, *args)
  File "/usr/lib/python2.7/dist-packages/cfgm_common/vnc_db.py", line 64, in locate
    obj = cls(key, *args)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 3838, in __init__
    ri.routing_policys[self.name] = ref['attr']['sequence']
TypeError: 'RoutingPolicyType' object has no attribute '__getitem__'

Tags: config
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/18033
Submitter: Sachin Bansal (<email address hidden>)

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

Review in progress for https://review.opencontrail.org/18034
Submitter: Sachin Bansal (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/18034
Committed: http://github.org/Juniper/contrail-controller/commit/407a3445a50c5367449bd8eeb6b6b0bfaa2e986a
Submitter: Zuul
Branch: R3.0

commit 407a3445a50c5367449bd8eeb6b6b0bfaa2e986a
Author: Sachin Bansal <email address hidden>
Date: Mon Feb 29 10:07:02 2016 -0800

Ref attribute is object, not a dict

Closes-Bug: 1551049

Change-Id: Ide6665c209fb3f8f209bb5dbde9f45347c7d9e7b
Signed-off-by: Sachin Bansal <email address hidden>

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

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

commit a2cdff00a3628a3169ea7187608c272ae2a661d3
Author: Sachin Bansal <email address hidden>
Date: Mon Feb 29 10:07:02 2016 -0800

Ref attribute is object, not a dict

Closes-Bug: 1551049

Change-Id: Ide6665c209fb3f8f209bb5dbde9f45347c7d9e7b

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.