[mainline 2709] contrail-schema traceback with route-aggregate config

Bug #1541221 reported by Prakash Bailkeri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Critical
Sachin Bansal

Bug Description

<type 'exceptions.AttributeError'>
Python 2.7.6: /usr/bin/python
Wed Feb 3 11:46:45 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()
  828 def server_main():
  829 cgitb.enable(format='text')
  830 main()
  831 # end server_main
  832
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')
  822 _zookeeper_client.master_election(zk_path_pfx + "/schema-transformer",
  823 os.getpid(), run_schema_transformer,
  824 args)
  825 # end main
  826
args = Namespace(admin_password='contrail123', admin_te...r_ip='10.204.216.23: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=30274, func=<function run_schema_transformer>, *args=(Namespace(admin_password='contrail123', admin_te...r_ip='10.204.216.23: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...r_ip='10.204.216.23: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...r_ip='10.204.216.23: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...r_ip='10.204.216.23: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...r_ip='10.204.216.23:2181', zk_server_port='2181'))
  803
  804 global transformer
  805 transformer = SchemaTransformer(args)
  806 gevent.joinall(transformer._vnc_kombu.greenlets())
  807 # end run_schema_transformer
global transformer = None
global SchemaTransformer = <class 'schema_transformer.to_bgp.SchemaTransformer'>
args = Namespace(admin_password='contrail123', admin_te...r_ip='10.204.216.23: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...r_ip='10.204.216.23:2181', zk_server_port='2181'))
  214 DBBaseST._vnc_lib = _vnc_lib
  215 ServiceChain.init()
  216 self.reinit()
  217 # create cpu_info object to send periodic updates
  218 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>)
  445 gevent.sleep(0.001)
  446 for si in ServiceInstanceST.list_vnc_obj():
  447 si_st = ServiceInstanceST.locate(si.get_fq_name_str(), si)
  448 if si_st is None:
  449 continue
si_st undefined
global ServiceInstanceST = <class 'schema_transformer.config_db.ServiceInstanceST'>
ServiceInstanceST.locate = <bound method __metaclass__.locate of <class 'schema_transformer.config_db.ServiceInstanceST'>>
si = <vnc_api.gen.resource_client.ServiceInstance object>
si.get_fq_name_str = <bound method ServiceInstance.get_fq_name_str of..._api.gen.resource_client.ServiceInstance object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in locate(cls=<class 'schema_transformer.config_db.ServiceInstanceST'>, key=u'default-domain:admin:bailkeri', *args=(<vnc_api.gen.resource_client.ServiceInstance object>,))
   95 @classmethod
   96 def locate(cls, key, *args):
   97 obj = super(DBBaseST, cls).locate(key, *args)
   98 if obj.obj.uuid not in cls._uuid_fq_name_map:
   99 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.ServiceInstanceST'>
).locate = <bound method __metaclass__.locate of <class 'schema_transformer.config_db.ServiceInstanceST'>>
key = u'default-domain:admin:bailkeri'
args = (<vnc_api.gen.resource_client.ServiceInstance object>,)

 /usr/lib/python2.7/dist-packages/cfgm_common/vnc_db.py in locate(cls=<class 'schema_transformer.config_db.ServiceInstanceST'>, key=u'default-domain:admin:bailkeri', *args=(<vnc_api.gen.resource_client.ServiceInstance 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.ServiceInstanceST'>
key = u'default-domain:admin:bailkeri'
args = (<vnc_api.gen.resource_client.ServiceInstance object>,)

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in __init__(self=<schema_transformer.config_db.ServiceInstanceST object>, name=u'default-domain:admin:bailkeri', obj=<vnc_api.gen.resource_client.ServiceInstance object>)
 3478 self.routing_policys[':'.join(ref['to'])] = ref['attr']
 3479 for ref in self.obj.get_route_aggregate_back_refs() or []:
 3480 self.route_aggregate[':'.join(ref['to'])] = ref['attr'].interface_type
 3481 self.set_children('port_tuple', self.obj)
 3482 # end __init__
self = <schema_transformer.config_db.ServiceInstanceST object>
self.route_aggregate undefined
ref = {'attr': {u'interface_type': u'right'}, 'href': '', 'to': [u'default-domain', u'default-project', u'left-to-right'], 'uuid': '63f9888b-eb7a-4269-b187-69d1ecaf2117'}
].interface_type undefined
<type 'exceptions.AttributeError'>: 'dict' object has no attribute 'interface_type'
    __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 = ("'dict' object has no attribute 'interface_type'",)
    message = "'dict' object has no attribute 'interface_type'"

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 830, in server_main
    main()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 824, 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 805, in run_schema_transformer
    transformer = SchemaTransformer(args)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 216, in __init__
    self.reinit()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 447, in reinit
    si_st = ServiceInstanceST.locate(si.get_fq_name_str(), si)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 97, 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 3480, in __init__
    self.route_aggregate[':'.join(ref['to'])] = ref['attr'].interface_type
AttributeError: 'dict' object has no attribute 'interface_type'

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

Review in progress for https://review.opencontrail.org/16847
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/16847
Committed: http://github.org/Juniper/contrail-controller/commit/4e19dcab52e40229cb180e3f3022d507bc4dff12
Submitter: Zuul
Branch: master

commit 4e19dcab52e40229cb180e3f3022d507bc4dff12
Author: Sachin Bansal <email address hidden>
Date: Wed Feb 3 15:41:51 2016 -0800

ref['attr'] is a dict, not an object

Change-Id: I164b019bcb3e0c8a1a643affa8e4295cbe3320da
Closes-Bug: 1541221

Nischal Sheth (nsheth)
information type: Proprietary → Public
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.