During SI creation, TypeError in contrail-api

Bug #1382385 reported by Vedamurthy Joshi
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R1.1
Won't Fix
High
Rudra Rugge
R2.0
Fix Committed
High
Rudra Rugge
Trunk
Fix Committed
High
Rudra Rugge

Bug Description

2.0-2397.el6 Build on Single node setup running parallel sanity scripts

svc-monitor.err.1 :
=================
<class 'cfgm_common.exceptions.HttpError'>
Python 2.6.6: /usr/bin/python
Fri Oct 17 10:39:21 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.6/site-packages/svc_monitor/svc_monitor.py in launch_arc(monitor=<svc_monitor.svc_monitor.SvcMonitor object>, ssrc_mapc=<cfgm_common.ifmap.client.client instance>)
  510 pollreq = PollRequest(arc_mapc.get_session_id())
  511 result = arc_mapc.call('poll', pollreq)
  512 monitor.process_poll_result(result)
  513 except exceptions.InvalidSessionID:
  514 cgitb_error_log(monitor)
monitor = <svc_monitor.svc_monitor.SvcMonitor object>
monitor.process_poll_result = <bound method SvcMonitor.process_poll_result of <svc_monitor.svc_monitor.SvcMonitor object>>
result = '<?xml version="1.0" encoding="UTF-8" standalone=...lResult></ns2:response></ns3:Body></ns3:Envelope>'

 /usr/lib/python2.6/site-packages/svc_monitor/svc_monitor.py in process_poll_result(self=<svc_monitor.svc_monitor.SvcMonitor object>, poll_result_str='<?xml version="1.0" encoding="UTF-8" standalone=...lResult></ns2:response></ns3:Body></ns3:Envelope>')
  493 self.logger.log("%s with %s/%s"
  494 % (funcname, meta_name, idents))
  495 func(idents)
  496 # end for meta
  497 # end for result_type
func = <bound method SvcMonitor._addmsg_service_instanc...e of <svc_monitor.svc_monitor.SvcMonitor object>>
idents = {'service-instance': 'default-domain:TestECMPSanity-38655777:in_net_svc_instance-65877660_1', 'service-template': 'default-domain:in_net_svc_template_1-00144212'}
 /usr/lib/python2.6/site-packages/svc_monitor/svc_monitor.py in _addmsg_service_instance_service_template(self=<svc_monitor.svc_monitor.SvcMonitor object>, idents={'service-instance': 'default-domain:TestECMPSanity-38655777:in_net_svc_instance-65877660_1', 'service-template': 'default-domain:in_net_svc_template_1-00144212'})
  388
  389 #launch VMs
  390 self._create_svc_instance(st_obj, si_obj)
  391 # end _addmsg_service_instance_service_template
  392
self = <svc_monitor.svc_monitor.SvcMonitor object>
self._create_svc_instance = <bound method SvcMonitor._create_svc_instance of <svc_monitor.svc_monitor.SvcMonitor object>>
st_obj = <vnc_api.gen.resource_client.ServiceTemplate object>
si_obj = <vnc_api.gen.resource_client.ServiceInstance object>

 /usr/lib/python2.6/site-packages/svc_monitor/svc_monitor.py in _create_svc_instance(self=<svc_monitor.svc_monitor.SvcMonitor object>, st_obj=<vnc_api.gen.resource_client.ServiceTemplate object>, si_obj=<vnc_api.gen.resource_client.ServiceInstance object>)
  280 virt_type = self._get_virtualization_type(st_props)
  281 if virt_type == 'virtual-machine':
  282 self.vm_manager.create_service(st_obj, si_obj)
  283 elif virt_type == 'network-namespace':
  284 self.netns_manager.create_service(st_obj, si_obj)
self = <svc_monitor.svc_monitor.SvcMonitor object>
self.vm_manager = <svc_monitor.instance_manager.VirtualMachineManager object>
self.vm_manager.create_service = <bound method VirtualMachineManager.create_servi...r.instance_manager.VirtualMachineManager object>>
st_obj = <vnc_api.gen.resource_client.ServiceTemplate object>
si_obj = <vnc_api.gen.resource_client.ServiceInstance object>

 /usr/lib/python2.6/site-packages/svc_monitor/instance_manager.py in create_service(self=<svc_monitor.instance_manager.VirtualMachineManager object>, st_obj=<vnc_api.gen.resource_client.ServiceTemplate object>, si_obj=<vnc_api.gen.resource_client.ServiceInstance object>)
  470 else:
  471 vm = self._create_svc_vm(instance_name, image_name, nics,
  472 flavor, st_obj, si_obj, avail_zone)
  473 if vm is None:
  474 continue
flavor = u'contrail_flavor_2cpu'
st_obj = <vnc_api.gen.resource_client.ServiceTemplate object>
si_obj = <vnc_api.gen.resource_client.ServiceInstance object>
avail_zone = None

 /usr/lib/python2.6/site-packages/svc_monitor/instance_manager.py in _create_svc_vm(self=<svc_monitor.instance_manager.VirtualMachineManager object>, instance_name=u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2', image_name=u'vsrx', nics=[{'net-id': u'2ff33d3f-b13c-401f-9da2-61d125bc85eb', 'shared-ip': False, 'static-route-enable': False, 'static-routes': <vnc_api.gen.resource_xsd.RouteTableType object>, 'type': u'management'}, {'net-id': u'104522a9-0eaf-4c2f-bc47-87b3c2dcc8c6', 'shared-ip': True, 'static-route-enable': False, 'static-routes': <vnc_api.gen.resource_xsd.RouteTableType object>, 'type': u'left'}, {'net-id': u'937c0d60-a1f5-46ca-b4c1-e3684135550a', 'shared-ip': False, 'static-route-enable': False, 'static-routes': <vnc_api.gen.resource_xsd.RouteTableType object>, 'type': u'right'}], flavor_name=u'contrail_flavor_2cpu', st_obj=<vnc_api.gen.resource_client.ServiceTemplate object>, si_obj=<vnc_api.gen.resource_client.ServiceInstance object>, avail_zone=None)
  393 nic_with_port = {}
  394 vmi_obj = self._create_svc_vm_port(nic, instance_name,
  395 st_obj, si_obj)
  396 nic_with_port['port-id'] = vmi_obj.get_uuid()
  397 nics_with_port.append(nic_with_port)
st_obj = <vnc_api.gen.resource_client.ServiceTemplate object>
si_obj = <vnc_api.gen.resource_client.ServiceInstance object>
 /usr/lib/python2.6/site-packages/svc_monitor/instance_manager.py in _create_svc_vm_port(self=<svc_monitor.instance_manager.VirtualMachineManager object>, nic={'net-id': u'2ff33d3f-b13c-401f-9da2-61d125bc85eb', 'shared-ip': False, 'static-route-enable': False, 'static-routes': <vnc_api.gen.resource_xsd.RouteTableType object>, 'type': u'management'}, instance_name=u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2', st_obj=<vnc_api.gen.resource_client.ServiceTemplate object>, si_obj=<vnc_api.gen.resource_client.ServiceInstance object>, local_preference=None, user_visible=None, ha_mode=None)
  194
  195 if vmi_create:
  196 self._vnc_lib.virtual_machine_interface_create(vmi_obj)
  197 elif vmi_updated:
  198 self._vnc_lib.virtual_machine_interface_update(vmi_obj)
self = <svc_monitor.instance_manager.VirtualMachineManager object>
self._vnc_lib = <vnc_api.vnc_api.VncApi object>
self._vnc_lib.virtual_machine_interface_create = <bound method VncApi.virtual_machine_interface_create of <vnc_api.vnc_api.VncApi object>>
vmi_obj = <vnc_api.gen.resource_client.VirtualMachineInterface object>

 /usr/lib/python2.6/site-packages/vnc_api/gen/vnc_api_client_gen.py in virtual_machine_interface_create(self=<vnc_api.vnc_api.VncApi object>, obj=<vnc_api.gen.resource_client.VirtualMachineInterface object>)
 5442 content = self._request_server(rest.OP_POST,
 5443 vnc_api.gen.resource_client.VirtualMachineInterface.create_uri,
 5444 data = json_body)
 5445
 5446 virtual_machine_interface_dict = json.loads(content)['virtual-machine-interface']
data undefined
json_body = '{"virtual-machine-interface":{"fq_name": ["defau...: null, "service_interface_type": "management"}}}'

 /usr/lib/python2.6/site-packages/vnc_api/vnc_api.py in _request_server(self=<vnc_api.vnc_api.VncApi object>, op=1, url=u'/virtual-machine-interfaces', data='{"virtual-machine-interface":{"fq_name": ["defau...: null, "service_interface_type": "management"}}}', retry_on_error=True, retry_after_authn=False, retry_count=30)
  381 raise BadRequest(status, content)
  382 else: # Unknown Error
  383 raise HttpError(status, content)
  384 # end while True
  385
global HttpError = <class 'cfgm_common.exceptions.HttpError'>
status = 500
content = u'Internal Server Error'
<class 'cfgm_common.exceptions.HttpError'>: HTTP Status: 500 Content: Internal Server Error
    __class__ = <class 'cfgm_common.exceptions.HttpError'>
    __delattr__ = <method-wrapper '__delattr__' of HttpError object>
    __dict__ = {'content': u'Internal Server Error', 'status_code': 500}
    __doc__ = None
    __format__ = <built-in method __format__ of HttpError object>
    __getattribute__ = <method-wrapper '__getattribute__' of HttpError object>
    __getitem__ = <method-wrapper '__getitem__' of HttpError object>
    __getslice__ = <method-wrapper '__getslice__' of HttpError object>
    __hash__ = <method-wrapper '__hash__' of HttpError object>
    __init__ = <bound method HttpError.__init__ of HttpError()>
    __module__ = 'cfgm_common.exceptions'
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of HttpError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of HttpError object>
    __repr__ = <method-wrapper '__repr__' of HttpError object>
    __repr__ = <method-wrapper '__repr__' of HttpError object>
    __setattr__ = <method-wrapper '__setattr__' of HttpError object>
    __setstate__ = <built-in method __setstate__ of HttpError object>
    __sizeof__ = <built-in method __sizeof__ of HttpError object>
    __str__ = <bound method HttpError.__str__ of HttpError()>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of HttpError object>
    __weakref__ = None
    args = ()
    content = u'Internal Server Error'
    message = ''
    status_code = 500

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.6/site-packages/svc_monitor/svc_monitor.py", line 512, in launch_arc
    monitor.process_poll_result(result)
  File "/usr/lib/python2.6/site-packages/svc_monitor/svc_monitor.py", line 495, in process_poll_result
    func(idents)
  File "/usr/lib/python2.6/site-packages/svc_monitor/svc_monitor.py", line 390, in _addmsg_service_instance_service_template
    self._create_svc_instance(st_obj, si_obj)
  File "/usr/lib/python2.6/site-packages/svc_monitor/svc_monitor.py", line 282, in _create_svc_instance
    self.vm_manager.create_service(st_obj, si_obj)
  File "/usr/lib/python2.6/site-packages/svc_monitor/instance_manager.py", line 472, in create_service
    flavor, st_obj, si_obj, avail_zone)
  File "/usr/lib/python2.6/site-packages/svc_monitor/instance_manager.py", line 395, in _create_svc_vm
    st_obj, si_obj)
  File "/usr/lib/python2.6/site-packages/svc_monitor/instance_manager.py", line 196, in _create_svc_vm_port
    self._vnc_lib.virtual_machine_interface_create(vmi_obj)
  File "/usr/lib/python2.6/site-packages/vnc_api/gen/vnc_api_client_gen.py", line 5444, in virtual_machine_interface_create
    data = json_body)
  File "/usr/lib/python2.6/site-packages/vnc_api/vnc_api.py", line 383, in _request_server
    raise HttpError(status, content)
HttpError: HTTP Status: 500 Content: Internal Server Error

contrail-api log:
================

10.204.217.12 - - [2014-10-17 10:39:21] "POST /virtual-machine-interfaces HTTP/1.1" 200 688 0.188771
10.204.217.12 - - [2014-10-17 10:39:21] "POST /fqname-to-id HTTP/1.1" 200 156 0.006233
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/bottle.py", line 763, in _handle
    return route.call(**args)
  File "/usr/lib/python2.6/site-packages/bottle.py", line 1624, in wrapper
    rv = callback(*a, **ka)
  File "/usr/lib/python2.6/site-packages/bottle.py", line 1574, in wrapper
    rv = callback(*a, **ka)
  File "/usr/lib/python2.6/site-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 471, in handler_trap_exception
    response = handler(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/vnc_cfg_api_server/gen/vnc_api_server_gen.py", line 19506, in virtual_machine_interfaces_http_post
    (ok, result) = r_class.http_post_collection(tenant_name, obj_dict, db_conn)
  File "/usr/lib/python2.6/site-packages/vnc_cfg_api_server/vnc_cfg_types.py", line 373, in http_post_collection
    mac_addr = cls.addr_mgmt.mac_alloc(obj_dict)
  File "/usr/lib/python2.6/site-packages/vnc_cfg_api_server/vnc_addr_mgmt.py", line 911, in mac_alloc
    return '02:%s:%s:%s:%s:%s' % (uid[0:2], uid[2:4], uid[4:6],
TypeError: 'NoneType' object is unsubscriptable
10.204.217.12 - - [2014-10-17 10:39:21] "POST /virtual-machine-interfaces HTTP/1.1" 500 156 0.288278
ERROR:nodec27:ApiServer:Config:0:__default__ [SYS_ERR]: VncApiError: <type 'exceptions.TypeError'>
Python 2.6.6: /usr/bin/python
Fri Oct 17 10:39:21 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.6/site-packages/vnc_cfg_api_server/vnc_cfg_api_server.py in handler_trap_exception(*args=(), **kwargs={})
  469 trace = self._generate_rest_api_request_trace()
  470 try:
  471 response = handler(*args, **kwargs)
  472 self._generate_rest_api_response_trace(trace, response)
  473 return response
response undefined
handler = <bound method VncApiServer.virtual_machine_inter...i_server.vnc_cfg_api_server.VncApiServer object>>
args = ()
kwargs = {}

 /usr/lib/python2.6/site-packages/vnc_cfg_api_server/gen/vnc_api_server_gen.py in virtual_machine_interfaces_http_post(self=<vnc_cfg_api_server.vnc_cfg_api_server.VncApiServer object>)
19504 r_class = self._resource_classes.get('virtual-machine-interface', None)
19505 if r_class:
19506 (ok, result) = r_class.http_post_collection(tenant_name, obj_dict, db_conn)
19507 if not ok:
19508 for fail_cleanup_callable, cleanup_args in cleanup_on_failure:
ok = 409
result = 'FQ Name: /fq-name-to-uuid/virtual_machine_interf...ady with ID: 12efc31a-da29-478a-905f-ed21db944c86'
r_class = <class 'vnc_cfg_api_server.vnc_cfg_types.VirtualMachineInterfaceServer'>
r_class.http_post_collection = <bound method type.http_post_collection of <clas...er.vnc_cfg_types.VirtualMachineInterfaceServer'>>
tenant_name = u'admin'
obj_dict = {'display_name': u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2-management', u'fq_name': [u'default-domain', u'TestECMPSanity-38655777', u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2-management'], 'id_perms': {u'created': 0, u'description': None, u'enable': True, u'last_modified': 0, u'permissions': {u'group': u'KeystoneAdmin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': None}, u'parent_type': u'project', u'security_group_refs': [{u'to': [u'default-domain', u'TestECMPSanity-38655777', u'default'], u'uuid': u'5f3f7f32-93a1-4448-a05f-0e443ff4a101'}], u'uuid': None, u'virtual_machine_interface_properties': {u'interface_mirror': None, u'local_preference': None, u'service_interface_type': u'management'}, u'virtual_network_refs': [{u'to': [u'default-domain', u'TestECMPSanity-38655777', u'svc-vn-mgmt'], u'uuid': u'2ff33d3f-b13c-401f-9da2-61d125bc85eb'}]}
db_conn = <vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>

 /usr/lib/python2.6/site-packages/vnc_cfg_api_server/vnc_cfg_types.py in http_post_collection(cls=<class 'vnc_cfg_api_server.vnc_cfg_types.VirtualMachineInterfaceServer'>, tenant_name=u'admin', obj_dict={'display_name': u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2-management', u'fq_name': [u'default-domain', u'TestECMPSanity-38655777', u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2-management'], 'id_perms': {u'created': 0, u'description': None, u'enable': True, u'last_modified': 0, u'permissions': {u'group': u'KeystoneAdmin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': None}, u'parent_type': u'project', u'security_group_refs': [{u'to': [u'default-domain', u'TestECMPSanity-38655777', u'default'], u'uuid': u'5f3f7f32-93a1-4448-a05f-0e443ff4a101'}], u'uuid': None, u'virtual_machine_interface_properties': {u'interface_mirror': None, u'local_preference': None, u'service_interface_type': u'management'}, u'virtual_network_refs': [{u'to': [u'default-domain', u'TestECMPSanity-38655777', u'svc-vn-mgmt'], u'uuid': u'2ff33d3f-b13c-401f-9da2-61d125bc85eb'}]}, db_conn=<vnc_cfg_api_server.vnc_cfg_ifmap.VncDbClient object>)
  371 mac_addrs_obj = MacAddressesType(inmac)
  372 else:
  373 mac_addr = cls.addr_mgmt.mac_alloc(obj_dict)
  374 mac_addrs_obj = MacAddressesType([mac_addr])
  375 mac_addrs_json = json.dumps(
mac_addr undefined
cls = <class 'vnc_cfg_api_server.vnc_cfg_types.VirtualMachineInterfaceServer'>
cls.addr_mgmt = <vnc_cfg_api_server.vnc_addr_mgmt.AddrMgmt object>
cls.addr_mgmt.mac_alloc = <bound method AddrMgmt.mac_alloc of <vnc_cfg_api_server.vnc_addr_mgmt.AddrMgmt object>>
obj_dict = {'display_name': u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2-management', u'fq_name': [u'default-domain', u'TestECMPSanity-38655777', u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2-management'], 'id_perms': {u'created': 0, u'description': None, u'enable': True, u'last_modified': 0, u'permissions': {u'group': u'KeystoneAdmin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': None}, u'parent_type': u'project', u'security_group_refs': [{u'to': [u'default-domain', u'TestECMPSanity-38655777', u'default'], u'uuid': u'5f3f7f32-93a1-4448-a05f-0e443ff4a101'}], u'uuid': None, u'virtual_machine_interface_properties': {u'interface_mirror': None, u'local_preference': None, u'service_interface_type': u'management'}, u'virtual_network_refs': [{u'to': [u'default-domain', u'TestECMPSanity-38655777', u'svc-vn-mgmt'], u'uuid': u'2ff33d3f-b13c-401f-9da2-61d125bc85eb'}]}

 /usr/lib/python2.6/site-packages/vnc_cfg_api_server/vnc_addr_mgmt.py in mac_alloc(self=<vnc_cfg_api_server.vnc_addr_mgmt.AddrMgmt object>, obj_dict={'display_name': u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2-management', u'fq_name': [u'default-domain', u'TestECMPSanity-38655777', u'default-domain__TestECMPSanity-38655777__fd281b8b-7be8-449f-a914-307616acbeef__2-management'], 'id_perms': {u'created': 0, u'description': None, u'enable': True, u'last_modified': 0, u'permissions': {u'group': u'KeystoneAdmin', u'group_access': 7, u'other_access': 7, u'owner': u'admin', u'owner_access': 7}, u'user_visible': True, u'uuid': None}, u'parent_type': u'project', u'security_group_refs': [{u'to': [u'default-domain', u'TestECMPSanity-38655777', u'default'], u'uuid': u'5f3f7f32-93a1-4448-a05f-0e443ff4a101'}], u'uuid': None, u'virtual_machine_interface_properties': {u'interface_mirror': None, u'local_preference': None, u'service_interface_type': u'management'}, u'virtual_network_refs': [{u'to': [u'default-domain', u'TestECMPSanity-38655777', u'svc-vn-mgmt'], u'uuid': u'2ff33d3f-b13c-401f-9da2-61d125bc85eb'}]})
  909 def mac_alloc(self, obj_dict):
  910 uid = obj_dict['uuid']
  911 return '02:%s:%s:%s:%s:%s' % (uid[0:2], uid[2:4], uid[4:6],
  912 uid[6:8], uid[9:11])
  913 # end mac_alloc
uid = None
<type 'exceptions.TypeError'>: 'NoneType' object is unsubscriptable
    __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 = ("'NoneType' object is unsubscriptable",)
    message = "'NoneType' object is unsubscriptable"

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.6/site-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 471, in handler_trap_exception
    response = handler(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/vnc_cfg_api_server/gen/vnc_api_server_gen.py", line 19506, in virtual_machine_interfaces_http_post
    (ok, result) = r_class.http_post_collection(tenant_name, obj_dict, db_conn)
  File "/usr/lib/python2.6/site-packages/vnc_cfg_api_server/vnc_cfg_types.py", line 373, in http_post_collection
    mac_addr = cls.addr_mgmt.mac_alloc(obj_dict)
  File "/usr/lib/python2.6/site-packages/vnc_cfg_api_server/vnc_addr_mgmt.py", line 911, in mac_alloc
    return '02:%s:%s:%s:%s:%s' % (uid[0:2], uid[2:4], uid[4:6],
TypeError: 'NoneType' object is unsubscriptable

10.204.217.12 - - [2014-10-17 10:39:21] "POST /fqname-to-id HTTP/1.1" 404 235 0.118877
10.204.217.12 - - [2014-10-17 10:39:22] "GET /instance-ip/d94744c7-c71e-4a73-976e-e4fbbff4c255?exclude_back_refs=True&exclude_children=True HTTP/1.1" 200 1500 0.085250
WARNING:keystoneclient.middleware.auth_token:Unable to find authentication token in headers

Tags: config sanity
Revision history for this message
Vedamurthy Joshi (vedujoshi) wrote :

All contrail logs on the config nodes will be in http://10.204.216.50/Docs/bugs/1382385

Revision history for this message
Vedamurthy Joshi (vedujoshi) wrote :

See this in R1.20 Build 59 as well

tags: added: blocker
Revision history for this message
Ashish Ranjan (aranjan-n) wrote :

We have a fix, but have decided not to put it in 2.0.

tags: removed: blocker
Revision history for this message
Hampapur Ajay (hajay) wrote :

Crucial clue from contrail-api log is
19505 if r_class:
19506 (ok, result) = r_class.http_post_collection(tenant_name, obj_dict, db_conn)
19507 if not ok:
19508 for fail_cleanup_callable, cleanup_args in cleanup_on_failure:

ok = 409
result = 'FQ Name: /fq-name-to-uuid/virtual_machine_interf...ady with ID: 12efc31a-da29-478a-905f-ed21db944c86'

So what has happened is VMI create was tried while another create with same name is in flight. Also timing is such that it wasn't existing at the http_post_common (which would have errored) but was present by the time dbe_alloc was called.

Bug is dbe_alloc is bailing with
1389 except ResourceExistsError as e:
1390 return (409, str(e))

instead of return (False, (409, str(e)))

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

Reviewed: https://review.opencontrail.org/5681
Committed: http://github.org/Juniper/contrail-controller/commit/0b86de3c7f7cf916ead823474c969569757b4617
Submitter: Zuul
Branch: R2.0

commit 0b86de3c7f7cf916ead823474c969569757b4617
Author: Hampapur Ajay <email address hidden>
Date: Mon Dec 15 23:03:46 2014 -0800

Return correct type from dbe_alloc in error(EEXISTS) case

In timing situations where a port-create is in-flight and
another for same name is received, when check for dup is
false in http_post_common but caught in dbe_alloc, the return
type in dbe_alloc was incorrect causing incorrect further
processing.

Change-Id: I34edf4d61c1edc9071da154747ff7066aeefef92
Closes-Bug: #1382385
(cherry picked from commit ba7cfcb0a0baffad5e57dd1a6d141608f072b001)

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

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

commit ba7cfcb0a0baffad5e57dd1a6d141608f072b001
Author: Hampapur Ajay <email address hidden>
Date: Mon Dec 15 23:03:46 2014 -0800

Return correct type from dbe_alloc in error(EEXISTS) case

In timing situations where a port-create is in-flight and
another for same name is received, when check for dup is
false in http_post_common but caught in dbe_alloc, the return
type in dbe_alloc was incorrect causing incorrect further
processing.

Change-Id: I34edf4d61c1edc9071da154747ff7066aeefef92
Closes-Bug: #1382385

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.