port delete fails since service-instance ip is not found for deletion

Bug #1688449 reported by Senthilnathan Murugappan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
High
Sachin Bansal

Bug Description

During VM deletion observed that port delete fails since service-instance ip is not found for deletion, due to which the VM deletion bails out. Believe Svc-Monitor had deleted the IIP in the meantime, hope if IIP is not found we should be good to go ahead with vmi deletion rather than bailing out.

Workaround is to reissue nova delete command.

05/04/2017 09:04:55 PM [contrail-api]: <class 'cfgm_common.exceptions.NoIdError'>
Python 2.7.6: /usr/bin/python
Thu May 4 21:04:55 2017

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_openstack/__init__.py in handler_trap_exception(*args=(), **kwargs={})
 1065 def handler_trap_exception(*args, **kwargs):
 1066 try:
 1067 response = handler(*args, **kwargs)
 1068 return response
 1069 except Exception as e:
response undefined
handler = <bound method NeutronPluginInterface.plugin_http..._plugin_interface.NeutronPluginInterface object>>
args = ()
kwargs = {}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py in plugin_http_post_port(self=<vnc_openstack.neutron_plugin_interface.NeutronPluginInterface object>)
  482 return self.plugin_update_port(context, port)
  483 elif context['operation'] == 'DELETE':
  484 return self.plugin_delete_port(context, port)
  485 elif context['operation'] == 'READALL':
  486 return self.plugin_get_ports(context, port)
self = <vnc_openstack.neutron_plugin_interface.NeutronPluginInterface object>
self.plugin_delete_port = <bound method NeutronPluginInterface.plugin_dele..._plugin_interface.NeutronPluginInterface object>>
context = {'is_admin': True, 'operation': 'DELETE', 'roles': ['admin'], 'tenant': '491e20bcaaba468b9e6fe1dfb4a530a8', 'tenant_id': '491e20bcaaba468b9e6fe1dfb4a530a8', 'type': 'port', 'user_id': '97ff76b0cf7d4c5aa90064c73da57268'}
port = {'fields': None, 'filters': None, 'id': '75a0a99a-beec-4e30-b370-f3bf55f8a9ec'}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py in plugin_delete_port(self=<vnc_openstack.neutron_plugin_interface.NeutronPluginInterface object>, context={'is_admin': True, 'operation': 'DELETE', 'roles': ['admin'], 'tenant': '491e20bcaaba468b9e6fe1dfb4a530a8', 'tenant_id': '491e20bcaaba468b9e6fe1dfb4a530a8', 'type': 'port', 'user_id': '97ff76b0cf7d4c5aa90064c73da57268'}, port={'fields': None, 'filters': None, 'id': '75a0a99a-beec-4e30-b370-f3bf55f8a9ec'})
  431 try:
  432 cfgdb = self._get_user_cfgdb(context)
  433 cfgdb.port_delete(port['id'])
  434 LOG.debug("plugin_delete_port(): " + pformat(port['id']))
  435 except Exception as e:
cfgdb = <vnc_openstack.neutron_plugin_db.DBInterface object>
cfgdb.port_delete = <bound method DBInterface.wrapper of <vnc_openstack.neutron_plugin_db.DBInterface object>>
port = {'fields': None, 'filters': None, 'id': '75a0a99a-beec-4e30-b370-f3bf55f8a9ec'}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in wrapper(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, *args=('75a0a99a-beec-4e30-b370-f3bf55f8a9ec',), **kwargs={})
 2558 def wrapper(self, *args, **kwargs):
 2559 self._connected_to_api_server.wait()
 2560 return func(self, *args, **kwargs)
 2561
 2562 return wrapper
func = <function port_delete>
self = <vnc_openstack.neutron_plugin_db.DBInterface object>
args = ('75a0a99a-beec-4e30-b370-f3bf55f8a9ec',)
kwargs = {}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in port_delete(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, port_id='75a0a99a-beec-4e30-b370-f3bf55f8a9ec')
 3988 # if name contains IP address then this is shared ip
 3989 iip_obj = self._vnc_lib.instance_ip_read(
 3990 id=iip_back_ref['uuid'])
 3991
 3992 # in case of shared ip only delete the link to the VMI
builtinid = <built-in function id>
iip_back_ref = {u'attr': None, u'to': [u'cc17e9b6-9bb0-427a-953e-f198ece5d890-right-v4'], u'uuid': u'63d43c32-7699-47b9-a302-0d2b96d213de'}

 /usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py in wrapper(self=<vnc_openstack.neutron_plugin_db.LocalVncApi object>, *args=('instance-ip',), **kwargs={'id': u'63d43c32-7699-47b9-a302-0d2b96d213de'})
   39 retry_on_error=False)
   40 self._parse_homepage(homepage)
   41 return func(self, *args, **kwargs)
   42 return wrapper
   43
func = <function _object_read>
self = <vnc_openstack.neutron_plugin_db.LocalVncApi object>
args = ('instance-ip',)
kwargs = {'id': u'63d43c32-7699-47b9-a302-0d2b96d213de'}
 /usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py in _object_read(self=<vnc_openstack.neutron_plugin_db.LocalVncApi object>, res_type='instance-ip', fq_name=None, fq_name_str=None, id=u'63d43c32-7699-47b9-a302-0d2b96d213de', ifmap_id=None, fields=None)
  541 query_params['exclude_hrefs'] = True
  542
  543 response = self._request_server(rest.OP_GET, uri, query_params)
  544
  545 obj_dict = response[res_type]
response undefined
self = <vnc_openstack.neutron_plugin_db.LocalVncApi object>
self._request_server = <bound method LocalVncApi._request_server of <vnc_openstack.neutron_plugin_db.LocalVncApi object>>
global rest = <module 'cfgm_common.rest' from '/usr/lib/python2.7/dist-packages/cfgm_common/rest.pyc'>
rest.OP_GET = 2
uri = u'/instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de'
query_params = {'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True}

 /usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py in _request_server(self=<vnc_openstack.neutron_plugin_db.LocalVncApi object>, op=2, url=u'/instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de', data={'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True}, retry_on_error=True, retry_after_authn=False, retry_count=30)
  855 return self._request(
  856 op, url, data=data, retry_on_error=retry_on_error,
  857 retry_after_authn=retry_after_authn, retry_count=retry_count)
  858 # end _request_server
  859
retry_after_authn = False
retry_count = 30

 /usr/lib/python2.7/dist-packages/vnc_openstack/context.py in wrapper(*args=(<vnc_openstack.neutron_plugin_db.LocalVncApi object>, 2, u'/instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de'), **kwargs={'data': {'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True}, 'retry_after_authn': False, 'retry_count': 30, 'retry_on_error': True})
   35
   36 try:
   37 return fn(*args, **kwargs)
   38 finally:
   39 if context_created:
fn = <function _request>
args = (<vnc_openstack.neutron_plugin_db.LocalVncApi object>, 2, u'/instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de')
kwargs = {'data': {'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True}, 'retry_after_authn': False, 'retry_count': 30, 'retry_on_error': True}
 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in _request(self=<vnc_openstack.neutron_plugin_db.LocalVncApi object>, op=2, url=u'/instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de', data={'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True}, *args=(), **kwargs={'retry_after_authn': False, 'retry_count': 30, 'retry_on_error': True})
   74 if op != rest.OP_GET or url not in self.api_server_routes:
   75 return super(LocalVncApi, self)._request(
   76 op, url, data, *args, **kwargs)
   77
   78 server_method = self.api_server_routes[url]
op = 2
url = u'/instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de'
data = {'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True}
args = ()
kwargs = {'retry_after_authn': False, 'retry_count': 30, 'retry_on_error': True}

 /usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py in _request(self=<vnc_openstack.neutron_plugin_db.LocalVncApi object>, op=2, url=u'/instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de', data={'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True}, retry_on_error=True, retry_after_authn=False, retry_count=30)
  933 elif status == 404:
  934 raise NoIdError('Error: oper %s url %s body %s response %s'
  935 % (op, url, data, content))
  936 elif status == 403:
  937 raise PermissionDenied(content)
op = 2
url = u'/instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de'
data = {'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True}
content = u'Unknown id: 63d43c32-7699-47b9-a302-0d2b96d213de'
<class 'cfgm_common.exceptions.NoIdError'>: Unknown id: Error: oper 2 url /instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de body {'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True} response Unknown id: 63d43c32-7699-47b9-a302-0d2b96d213de
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_openstack/__init__.py", line 1067, in handler_trap_exception
    response = handler(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 484, in plugin_http_post_port
    return self.plugin_delete_port(context, port)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 433, in plugin_delete_port
    cfgdb.port_delete(port['id'])
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 2560, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 3990, in port_delete
    id=iip_back_ref['uuid'])
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 41, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 543, in _object_read
    response = self._request_server(rest.OP_GET, uri, query_params)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 857, in _request_server
    retry_after_authn=retry_after_authn, retry_count=retry_count)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/context.py", line 37, in wrapper
    return fn(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 76, in _request
    op, url, data, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 935, in _request
    % (op, url, data, content))
NoIdError: Unknown id: Error: oper 2 url /instance-ip/63d43c32-7699-47b9-a302-0d2b96d213de body {'exclude_back_refs': True, 'exclude_children': True, 'exclude_hrefs': True} response Unknown id: 63d43c32-7699-47b9-a302-0d2b96d213de

tags: added: sanity
Jeba Paulaiyan (jebap)
tags: added: blocker
information type: Proprietary → Public
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/31031
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/31031
Committed: http://github.com/Juniper/contrail-controller/commit/87c233f6f5150d76bd5d01eb193fa2e3c5199a70
Submitter: Zuul (<email address hidden>)
Branch: master

commit 87c233f6f5150d76bd5d01eb193fa2e3c5199a70
Author: Sachin Bansal <email address hidden>
Date: Thu May 4 22:21:30 2017 -0700

Ignore NoIdError for instance-ip while deleting port

Shared ip address could be deleted by service monitor. We should
ignore NoIdError in this case.
Also, the VM could have been deleted separately. Ignore that too.

Change-Id: Ib3076e25fb94aca8d076db0dbeb3e74350eb3fcf
Closes-Bug: 1688449
Closes-Bug: 1688450

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.