[Ubuntu 14.04.4 LTS" 3.1.0.0-17~kilo] Schema errors while deleting the service chain heat stack

Bug #1611064 reported by Chandra Sekhar Reddy Mallam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.1
Fix Committed
High
Suresh Balineni
Trunk
Fix Committed
High
Suresh Balineni

Bug Description

Below schema errors are observed while deleting the service chain heat stack.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 341, in _vnc_subscribe_callback
    res_obj.evaluate()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 1238, in evaluate
    primary_ri.update_static_routes()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 2155, in update_static_routes
    sc_address = {4: si.get_allocated_interface_ip("left", 4),
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 3837, in get_allocated_interface_ip
    vmi = vm_pt.get_vmi_by_service_type(side)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 4162, in get_vmi_by_service_type
    if vmi.service_interface_type == service_type:
AttributeError: 'NoneType' object has no attribute 'service_interface_type'

Steps to reproduce
 1. Successfully launched service chain with attached heat template (heat_contrail_service_chain.yaml, heat_contrail_service_chain.env i.e CIDR based policy for service chaining)
 2. Verified service chain functionality and is working fine
 3. Now, deleted the stack. Now, while deleting the stack, observed above schema errors.

Please see the log below:

 1. Service chain creation

Output from heat stack-create for service chain template
root@nodei15:/tmp# heat stack-create -f heat_contrail_service_chain.yaml -e heat_contrail_service_chain.env cidr_test
+--------------------------------------+------------+--------------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+--------------------+----------------------+
| 7abe278c-475b-4d67-a11b-4e4ce8384625 | cidr_test | CREATE_IN_PROGRESS | 2016-08-08T17:20:03Z |
+--------------------------------------+------------+--------------------+----------------------+
root@nodei15:/tmp# heat stack-list
+--------------------------------------+------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+-----------------+----------------------+
| 7abe278c-475b-4d67-a11b-4e4ce8384625 | cidr_test | CREATE_COMPLETE | 2016-08-08T17:20:03Z |
+--------------------------------------+------------+-----------------+----------------------+
root@nodei15:/tmp# heat stack-show 7abe278c-475b-4d67-a11b-4e4ce8384625
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------+
| capabilities | [] |
| creation_time | 2016-08-08T17:20:03Z |
| description | No description |
| disable_rollback | True |
| id | 7abe278c-475b-4d67-a11b-4e4ce8384625 |
| links | http://10.204.217.127:8004/v1/3cdad991e64641a49bf9f3c583d8508e/stacks/cidr_test/7abe278c-475b-4d67-a11b-4e4ce8384625 (self) |
| notification_topics | [] |
| outputs | [] |
| parameters | { |
| | "OS::project_id": "3cdad991e64641a49bf9f3c583d8508e", |
| | "domain": "default-domain", |
| | "dst_port_end": "-1", |
| | "protocol": "any", |
| | "pt1_name": "pt1", |
| | "service_template_properties_version": "2", |
| | "right_vn_fqdn": "default-domain:admin:right_vn", |
| | "image": "cirros-0.3.0-x86_64-uec", |
| | "service_instance1_name": "my-NAT-SI", |
| | "service_template_properties_ordered_interfaces": "True", |
| | "policy_fq_name": "default-domain:admin:pt_policy", |
| | "network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_3": "20.20.20.0", |
| | "network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2": "10.10.10.0", |
| | "simple_action": "pass", |
| | "flavor": "m1.tiny", |
| | "src_port_start": "-1", |
| | "network_policy_entries_policy_rule_src_addresses_subnet_ip_prefix": "10.10.10.3", |
| | "service_template1_name": "pt_template1", |
| | "left_vm1_name": "left_vm1", |
| | "service_template_properties_service_virtualization_type": "virtual-machine", |
| | "network_policy_entries_policy_rule_src_addresses_subnet_ip_prefix_len": "32", |
| | "service_template_properties_service_type": "firewall", |
| | "network_ipam_refs_data_ipam_subnets_addr_from_start_true": "True", |
| | "network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_3": "24", |
| | "network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2": "24", |
| | "network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_1": "24", |
| | "src_port_end": "-1", |
| | "svm1_image": "vsrx-nat", |
| | "direction": "<>", |
| | "OS::stack_name": "cidr_test", |
| | "left_vn_fqdn": "default-domain:admin:left_vn", |
| | "apply_services": "default-domain:admin:my-NAT-SI", |
| | "service_instance1_fq_name": "default-domain:admin:pt_instance1", |
| | "svm1_flavor": "m1.medium", |
| | "right_vn": "right_vn", |
| | "service_template1_properties_interface_type_service_interface_type_2": "left", |
| | "policy_name": "pt_policy", |
| | "dst_port_start": "-1", |
| | "left_vn": "left_vn", |
| | "service_template1_properties_service_mode": "in-network-nat", |
| | "management_network": "management_vn", |
| | "service_template1_properties_interface_type_service_interface_type_3": "right", |
| | "OS::stack_id": "7abe278c-475b-4d67-a11b-4e4ce8384625", |
| | "service_template1_properties_interface_type_service_interface_type_1": "management", |
| | "right_vm_name": "right_vm", |
| | "left_vm2_name": "left_vm2", |
| | "network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_1": "30.30.30.0", |
| | "svm1_name": "pt_svm1" |
| | } |
| parent | None |
| stack_name | cidr_test |
| stack_owner | admin |
| stack_status | CREATE_COMPLETE |
| stack_status_reason | Stack CREATE completed successfully |
| stack_user_project_id | 3cdad991e64641a49bf9f3c583d8508e |
| template_description | No description |
| timeout_mins | None |
| updated_time | None |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------+
root@nodei15:/tmp#

 2. Verified service chain functionality and is working fine.
 3. Now, deleting the stack
root@nodei15:/tmp# heat stack-delete cidr_test
+--------------------------------------+------------+--------------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+--------------------+----------------------+
| 7abe278c-475b-4d67-a11b-4e4ce8384625 | cidr_test | DELETE_IN_PROGRESS | 2016-08-08T17:20:03Z |
+--------------------------------------+------------+--------------------+----------------------+
root@nodei15:/tmp#

Now, seeing below schema errors.

<type 'exceptions.AttributeError'>
Python 2.7.6: /usr/bin/python
Mon Aug 8 22:45:35 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/schema_transformer/to_bgp.py in _vnc_subscribe_callback(self=<schema_transformer.to_bgp.SchemaTransformer object>, oper_info={u'imid': u'contrail:virtual-machine-interface:default-dom...e-interface-ccbeda32-de21-41ec-81ae-1621df42bd98', u'obj_dict': {u'display_name': u'default-virtual-machine-interface-ccbeda32-de21-41ec-81ae-1621df42bd98', u'fq_name': [u'default-domain', u'ctest-TestHeatv2-92256861', u'default-virtual-machine-interface-ccbeda32-de21-41ec-81ae-1621df42bd98'], u'id_perms': {u'created': u'2016-08-08T11:31:40.956592', u'creator': None, u'description': None, u'enable': True, u'last_modified': u'2016-08-08T17:15:31.202467', u'permissions': {u'group': u'admin', u'group_access': 7, u'other_access': 7, u'owner': u'TestHeatv2', u'owner_access': 7}, u'user_visible': True, u'uuid': {u'uuid_lslong': 9344430611575782808L, u'uuid_mslong': 14753469341322265068L}}, u'instance_ip_back_refs': [{u'attr': None, u'href': u'http://10.204.217.127:8082/instance-ip/04e552c0-52fd-4800-9384-a39042575781', u'to': [u'5a851c74-9c88-4074-bdf9-42ddf6a46e2a-left-v4'], u'uuid': u'04e552c0-52fd-4800-9384-a39042575781'}], u'parent_href': u'http://10.204.217.127:8082/project/1537191f-a069-456e-bf38-ee850296d7f6', u'parent_type': u'project', u'parent_uuid': u'1537191f-a069-456e-bf38-ee850296d7f6', u'perms2': {u'global_access': 0, u'owner': u'1537191fa069456ebf38ee850296d7f6', u'owner_access': 7, u'share': []}, u'port_tuple_refs': [{u'attr': None, u'href': u'http://10.204.217.127:8082/port-tuple/b2c86434-dc24-47f6-b9c5-806056d876f0', u'to': [u'default-domain', u'ctest-TestHeatv2-92256861', u'my-NAT-SI', u'pt_test_cidr'], u'uuid': u'b2c86434-dc24-47f6-b9c5-806056d876f0'}], u'routing_instance_refs': [{u'attr': {u'direction': u'both', u'dst_mac': None, u'ipv6_service_chain_address': None, u'mpls_label': None, u'protocol': None, u'service_chain_address': None, u'src_mac': None, u'vlan_tag': None}, u'href': u'http://10.204.217.127:8082/routing-instance/e0040b00-1365-4de9-a300-bad60b252f34', u'to': [u'default-domain', u'ctest-TestHeatv2-92256861', u'left_vn', u'left_vn'], u'uuid': u'e0040b00-1365-4de9-a300-bad60b252f34'}], ...}, u'oper': u'DELETE', u'parent_imid': u'contrail:project:default-domain:ctest-TestHeatv2-92256861', u'type': u'virtual_machine_interface', u'uuid': u'ccbeda32-de21-41ec-81ae-1621df42bd98'})
  339 res_obj = cls.get(res_id)
  340 if res_obj is not None:
  341 res_obj.evaluate()
  342
  343 for vn_id in dependency_tracker.resources.get('virtual_network', []):
res_obj = <schema_transformer.config_db.VirtualNetworkST object>
res_obj.evaluate = <bound method VirtualNetworkST.evaluate of <schema_transformer.config_db.VirtualNetworkST object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in evaluate(self=<schema_transformer.config_db.VirtualNetworkST object>)
 1236 primary_ri = self.get_primary_routing_instance()
 1237 if primary_ri:
 1238 primary_ri.update_static_routes()
 1239 self.update_pnf_presence()
 1240 self.check_multi_policy_service_chain_status()
primary_ri = <schema_transformer.config_db.RoutingInstanceST object>
primary_ri.update_static_routes = <bound method RoutingInstanceST.update_static_ro..._transformer.config_db.RoutingInstanceST object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in update_static_routes(self=<schema_transformer.config_db.RoutingInstanceST object>)
 2153 continue
 2154 route_tables = RouteTableST.get_by_service_instance(si.name)
 2155 sc_address = {4: si.get_allocated_interface_ip("left", 4),
 2156 6: si.get_allocated_interface_ip("left", 6)}
 2157 for route_table_name in route_tables:
sc_address undefined
si = <schema_transformer.config_db.ServiceInstanceST object>
si.get_allocated_interface_ip = <bound method ServiceInstanceST.get_allocated_in..._transformer.config_db.ServiceInstanceST object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in get_allocated_interface_ip(self=<schema_transformer.config_db.ServiceInstanceST object>, side='left', version=4)
 3835 if not vm_pt:
 3836 continue
 3837 vmi = vm_pt.get_vmi_by_service_type(side)
 3838 if not vmi:
 3839 continue
vmi undefined
vm_pt = <schema_transformer.config_db.PortTupleST object>
vm_pt.get_vmi_by_service_type = <bound method PortTupleST.get_vmi_by_service_typ...schema_transformer.config_db.PortTupleST object>>
side = 'left'

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in get_vmi_by_service_type(self=<schema_transformer.config_db.PortTupleST object>, service_type='left')
 4160 for vmi_name in self.virtual_machine_interfaces:
 4161 vmi = VirtualMachineInterfaceST.get(vmi_name)
 4162 if vmi.service_interface_type == service_type:
 4163 return vmi
 4164 return None
vmi = None
vmi.service_interface_type undefined
service_type = 'left'
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'service_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 = ("'NoneType' object has no attribute 'service_interface_type'",)
    message = "'NoneType' object has no attribute 'service_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/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 341, in _vnc_subscribe_callback
    res_obj.evaluate()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 1238, in evaluate
    primary_ri.update_static_routes()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 2155, in update_static_routes
    sc_address = {4: si.get_allocated_interface_ip("left", 4),
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 3837, in get_allocated_interface_ip
    vmi = vm_pt.get_vmi_by_service_type(side)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 4162, in get_vmi_by_service_type
    if vmi.service_interface_type == service_type:
AttributeError: 'NoneType' object has no attribute 'service_interface_type'

<type 'exceptions.AttributeError'>
Python 2.7.6: /usr/bin/python
Mon Aug 8 22:45:35 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/schema_transformer/to_bgp.py in _vnc_subscribe_callback(self=<schema_transformer.to_bgp.SchemaTransformer object>, oper_info={u'imid': u'contrail:virtual-machine-interface:default-dom...e-interface-18ed03d9-f87f-475b-882e-96a3d71b76b6', u'obj_dict': {u'display_name': u'default-virtual-machine-interface-18ed03d9-f87f-475b-882e-96a3d71b76b6', u'fq_name': [u'default-domain', u'ctest-TestHeatv2-92256861', u'default-virtual-machine-interface-18ed03d9-f87f-475b-882e-96a3d71b76b6'], u'id_perms': {u'created': u'2016-08-08T11:31:40.270908', u'creator': None, u'description': None, u'enable': True, u'last_modified': u'2016-08-08T17:15:25.747651', u'permissions': {u'group': u'admin', u'group_access': 7, u'other_access': 7, u'owner': u'TestHeatv2', u'owner_access': 7}, u'user_visible': True, u'uuid': {u'uuid_lslong': 9812946268519626422L, u'uuid_mslong': 1796096061102573403}}, u'instance_ip_back_refs': [{u'attr': None, u'href': u'http://10.204.217.127:8082/instance-ip/6b9c1f87-b785-45bf-bb87-c23c4a2221e8', u'to': [u'5a851c74-9c88-4074-bdf9-42ddf6a46e2a-right-v4'], u'uuid': u'6b9c1f87-b785-45bf-bb87-c23c4a2221e8'}], u'parent_href': u'http://10.204.217.127:8082/project/1537191f-a069-456e-bf38-ee850296d7f6', u'parent_type': u'project', u'parent_uuid': u'1537191f-a069-456e-bf38-ee850296d7f6', u'perms2': {u'global_access': 0, u'owner': u'1537191fa069456ebf38ee850296d7f6', u'owner_access': 7, u'share': []}, u'port_tuple_refs': [{u'attr': None, u'href': u'http://10.204.217.127:8082/port-tuple/b2c86434-dc24-47f6-b9c5-806056d876f0', u'to': [u'default-domain', u'ctest-TestHeatv2-92256861', u'my-NAT-SI', u'pt_test_cidr'], u'uuid': u'b2c86434-dc24-47f6-b9c5-806056d876f0'}], u'routing_instance_refs': [{u'attr': {u'direction': u'both', u'dst_mac': None, u'ipv6_service_chain_address': None, u'mpls_label': None, u'protocol': None, u'service_chain_address': None, u'src_mac': None, u'vlan_tag': None}, u'href': u'http://10.204.217.127:8082/routing-instance/53d20099-e62e-4090-b846-3f1fec2b12b9', u'to': [u'default-domain', u'ctest-TestHeatv2-92256861', u'right_vn', u'right_vn'], u'uuid': u'53d20099-e62e-4090-b846-3f1fec2b12b9'}], ...}, u'oper': u'DELETE', u'parent_imid': u'contrail:project:default-domain:ctest-TestHeatv2-92256861', u'type': u'virtual_machine_interface', u'uuid': u'18ed03d9-f87f-475b-882e-96a3d71b76b6'})
  339 res_obj = cls.get(res_id)
  340 if res_obj is not None:
  341 res_obj.evaluate()
  342
  343 for vn_id in dependency_tracker.resources.get('virtual_network', []):
res_obj = <schema_transformer.config_db.VirtualNetworkST object>
res_obj.evaluate = <bound method VirtualNetworkST.evaluate of <schema_transformer.config_db.VirtualNetworkST object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in evaluate(self=<schema_transformer.config_db.VirtualNetworkST object>)
 1236 primary_ri = self.get_primary_routing_instance()
 1237 if primary_ri:
 1238 primary_ri.update_static_routes()
 1239 self.update_pnf_presence()
 1240 self.check_multi_policy_service_chain_status()
primary_ri = <schema_transformer.config_db.RoutingInstanceST object>
primary_ri.update_static_routes = <bound method RoutingInstanceST.update_static_ro..._transformer.config_db.RoutingInstanceST object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in update_static_routes(self=<schema_transformer.config_db.RoutingInstanceST object>)
 2153 continue
 2154 route_tables = RouteTableST.get_by_service_instance(si.name)
 2155 sc_address = {4: si.get_allocated_interface_ip("left", 4),
 2156 6: si.get_allocated_interface_ip("left", 6)}
 2157 for route_table_name in route_tables:
sc_address undefined
si = <schema_transformer.config_db.ServiceInstanceST object>
si.get_allocated_interface_ip = <bound method ServiceInstanceST.get_allocated_in..._transformer.config_db.ServiceInstanceST object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in get_allocated_interface_ip(self=<schema_transformer.config_db.ServiceInstanceST object>, side='left', version=4)
 3835 if not vm_pt:
 3836 continue
 3837 vmi = vm_pt.get_vmi_by_service_type(side)
 3838 if not vmi:
 3839 continue
vmi undefined
vm_pt = <schema_transformer.config_db.PortTupleST object>
vm_pt.get_vmi_by_service_type = <bound method PortTupleST.get_vmi_by_service_typ...schema_transformer.config_db.PortTupleST object>>
side = 'left'

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in get_vmi_by_service_type(self=<schema_transformer.config_db.PortTupleST object>, service_type='left')
 4160 for vmi_name in self.virtual_machine_interfaces:
 4161 vmi = VirtualMachineInterfaceST.get(vmi_name)
 4162 if vmi.service_interface_type == service_type:
 4163 return vmi
 4164 return None
vmi = None
vmi.service_interface_type undefined
service_type = 'left'
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'service_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 = ("'NoneType' object has no attribute 'service_interface_type'",)
    message = "'NoneType' object has no attribute 'service_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/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 341, in _vnc_subscribe_callback
    res_obj.evaluate()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 1238, in evaluate
    primary_ri.update_static_routes()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 2155, in update_static_routes
    sc_address = {4: si.get_allocated_interface_ip("left", 4),
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 3837, in get_allocated_interface_ip
    vmi = vm_pt.get_vmi_by_service_type(side)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 4162, in get_vmi_by_service_type
    if vmi.service_interface_type == service_type:
AttributeError: 'NoneType' object has no attribute 'service_interface_type'

<type 'exceptions.AttributeError'>
Python 2.7.6: /usr/bin/python
Mon Aug 8 22:45:35 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/schema_transformer/to_bgp.py in _vnc_subscribe_callback(self=<schema_transformer.to_bgp.SchemaTransformer object>, oper_info={u'imid': u'contrail:virtual-machine-interface:default-dom...eatv2-92256861:default-virtual-machine-interface', u'obj_dict': {u'display_name': u'default-virtual-machine-interface', u'fq_name': [u'default-domain', u'ctest-TestHeatv2-92256861', u'default-virtual-machine-interface'], u'id_perms': {u'created': u'2016-08-08T11:31:39.721164', u'creator': None, u'description': None, u'enable': True, u'last_modified': u'2016-08-08T17:15:26.018476', u'permissions': {u'group': u'admin', u'group_access': 7, u'other_access': 7, u'owner': u'TestHeatv2', u'owner_access': 7}, u'user_visible': True, u'uuid': {u'uuid_lslong': 10017994113445237409L, u'uuid_mslong': 12189113688903208039L}}, u'instance_ip_back_refs': [{u'attr': None, u'href': u'http://10.204.217.127:8082/instance-ip/d17ede1a-5503-4a41-b94c-3b9e221eba5c', u'to': [u'5a851c74-9c88-4074-bdf9-42ddf6a46e2a-management-v4'], u'uuid': u'd17ede1a-5503-4a41-b94c-3b9e221eba5c'}], u'parent_href': u'http://10.204.217.127:8082/project/1537191f-a069-456e-bf38-ee850296d7f6', u'parent_type': u'project', u'parent_uuid': u'1537191f-a069-456e-bf38-ee850296d7f6', u'perms2': {u'global_access': 0, u'owner': u'1537191fa069456ebf38ee850296d7f6', u'owner_access': 7, u'share': []}, u'port_tuple_refs': [{u'attr': None, u'href': u'http://10.204.217.127:8082/port-tuple/b2c86434-dc24-47f6-b9c5-806056d876f0', u'to': [u'default-domain', u'ctest-TestHeatv2-92256861', u'my-NAT-SI', u'pt_test_cidr'], u'uuid': u'b2c86434-dc24-47f6-b9c5-806056d876f0'}], u'routing_instance_refs': [{u'attr': {u'direction': u'both', u'dst_mac': None, u'ipv6_service_chain_address': None, u'mpls_label': None, u'protocol': None, u'service_chain_address': None, u'src_mac': None, u'vlan_tag': None}, u'href': u'http://10.204.217.127:8082/routing-instance/4448086d-9e72-4ecc-851d-1eb05cffd28c', u'to': [u'default-domain', u'ctest-TestHeatv2-92256861', u'management_vn', u'management_vn'], u'uuid': u'4448086d-9e72-4ecc-851d-1eb05cffd28c'}], ...}, u'oper': u'DELETE', u'parent_imid': u'contrail:project:default-domain:ctest-TestHeatv2-92256861', u'type': u'virtual_machine_interface', u'uuid': u'a9286e51-c1ed-4c67-8b07-10918ddb92a1'})
  339 res_obj = cls.get(res_id)
  340 if res_obj is not None:
  341 res_obj.evaluate()
  342
  343 for vn_id in dependency_tracker.resources.get('virtual_network', []):
res_obj = <schema_transformer.config_db.VirtualNetworkST object>
res_obj.evaluate = <bound method VirtualNetworkST.evaluate of <schema_transformer.config_db.VirtualNetworkST object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in evaluate(self=<schema_transformer.config_db.VirtualNetworkST object>)
 1236 primary_ri = self.get_primary_routing_instance()
 1237 if primary_ri:
 1238 primary_ri.update_static_routes()
 1239 self.update_pnf_presence()
 1240 self.check_multi_policy_service_chain_status()
primary_ri = <schema_transformer.config_db.RoutingInstanceST object>
primary_ri.update_static_routes = <bound method RoutingInstanceST.update_static_ro..._transformer.config_db.RoutingInstanceST object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in update_static_routes(self=<schema_transformer.config_db.RoutingInstanceST object>)
 2153 continue
 2154 route_tables = RouteTableST.get_by_service_instance(si.name)
 2155 sc_address = {4: si.get_allocated_interface_ip("left", 4),
 2156 6: si.get_allocated_interface_ip("left", 6)}
 2157 for route_table_name in route_tables:
sc_address undefined
si = <schema_transformer.config_db.ServiceInstanceST object>
si.get_allocated_interface_ip = <bound method ServiceInstanceST.get_allocated_in..._transformer.config_db.ServiceInstanceST object>>

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in get_allocated_interface_ip(self=<schema_transformer.config_db.ServiceInstanceST object>, side='left', version=4)
 3835 if not vm_pt:
 3836 continue
 3837 vmi = vm_pt.get_vmi_by_service_type(side)
 3838 if not vmi:
 3839 continue
vmi undefined
vm_pt = <schema_transformer.config_db.PortTupleST object>
vm_pt.get_vmi_by_service_type = <bound method PortTupleST.get_vmi_by_service_typ...schema_transformer.config_db.PortTupleST object>>
side = 'left'

 /usr/lib/python2.7/dist-packages/schema_transformer/config_db.py in get_vmi_by_service_type(self=<schema_transformer.config_db.PortTupleST object>, service_type='left')
 4160 for vmi_name in self.virtual_machine_interfaces:
 4161 vmi = VirtualMachineInterfaceST.get(vmi_name)
 4162 if vmi.service_interface_type == service_type:
 4163 return vmi
 4164 return None
vmi = None
vmi.service_interface_type undefined
service_type = 'left'
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'service_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 = ("'NoneType' object has no attribute 'service_interface_type'",)
    message = "'NoneType' object has no attribute 'service_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/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 341, in _vnc_subscribe_callback
    res_obj.evaluate()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 1238, in evaluate
    primary_ri.update_static_routes()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 2155, in update_static_routes
    sc_address = {4: si.get_allocated_interface_ip("left", 4),
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 3837, in get_allocated_interface_ip
    vmi = vm_pt.get_vmi_by_service_type(side)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 4162, in get_vmi_by_service_type
    if vmi.service_interface_type == service_type:
AttributeError: 'NoneType' object has no attribute 'service_interface_type'

Tags: config
Revision history for this message
Chandra Sekhar Reddy Mallam (cmallam) wrote :
Revision history for this message
Chandra Sekhar Reddy Mallam (cmallam) wrote :

Attaching the heat templates

Changed in juniperopenstack:
importance: Undecided → High
assignee: nobody → Sachin Bansal (sbansal)
milestone: r3.1.0.0-fcs → none
tags: added: config
Sachin Bansal (sbansal)
Changed in juniperopenstack:
assignee: Sachin Bansal (sbansal) → Suresh Balineni (sbalineni)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/23110
Submitter: Suresh Balineni (<email address hidden>)

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

Review in progress for https://review.opencontrail.org/23111
Submitter: Suresh Balineni (<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/23112
Submitter: Suresh Balineni (<email address hidden>)

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

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

commit b7f4461599b8c5c22ce3ff3b1f776279945dc5b1
Author: sbalineni <email address hidden>
Date: Tue Aug 9 10:48:35 2016 -0700

[ST]: handle gracefully if VMI is deleted while allocating service interface ip

Change-Id: I7afcc2aa70dde8b117fd6ffb5fada011325c0f21
Closes-Bug: #1611064

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

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

commit 84813fa7c0db5d6767a5cf2805ed43fe0ff3f6a2
Author: sbalineni <email address hidden>
Date: Tue Aug 9 10:48:35 2016 -0700

[ST]: handle gracefully if VMI is deleted while allocating service interface ip

Change-Id: I7afcc2aa70dde8b117fd6ffb5fada011325c0f21
Closes-Bug: #1611064

Ganesha HV (ganeshahv)
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.