HTTPError 500 while running tempest test test_create_list_show_delete_interfaces

Bug #1604354 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.1
Fix Committed
Undecided
Sahil Sabharwal
Trunk
Fix Committed
Undecided
Sahil Sabharwal

Bug Description

R3.0.1.0 Build 52 Liberty

Test : tempest.api.compute.servers.test_attach_interfaces.AttachInterfacesTestJSON.test_create_list_show_delete_interfaces

The test tries to attach the first IP in the subnet to the VM.

Contrail-api returns "PermissionDenied: Gateway IP cannot be used by VM port"

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tempest/test.py", line 106, in wrapper
    return f(self, *func_args, **func_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tempest/api/compute/servers/test_attach_interfaces.py", line 187, in test_create_list_show_delete_interfaces
    server, ifs = self._create_server_get_interfaces()
  File "/usr/local/lib/python2.7/dist-packages/tempest/api/compute/servers/test_attach_interfaces.py", line 138, in _test_create_interface_by_fixed_ips
    fixed_ips=fixed_ips)['interfaceAttachment']
  File "/usr/local/lib/python2.7/dist-packages/tempest/lib/services/compute/interfaces_client.py", line 40, in create_interface
    body=post_body)
  File "/usr/local/lib/python2.7/dist-packages/tempest/lib/common/rest_client.py", line 270, in post
    return self.request('POST', url, extra_headers, headers, body, chunked)
  File "/usr/local/lib/python2.7/dist-packages/tempest/lib/services/compute/base_compute_client.py", line 48, in request
    method, url, extra_headers, headers, body, chunked)
  File "/usr/local/lib/python2.7/dist-packages/tempest/lib/common/rest_client.py", line 664, in request
    resp, resp_body)
  File "/usr/local/lib/python2.7/dist-packages/tempest/lib/common/rest_client.py", line 828, in _error_checker
    message=message)
ServerFault: Got server fault
Details: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'oslo_messaging.rpc.client.RemoteError'>

Contrail-api log :

<class 'cfgm_common.exceptions.PermissionDenied'>
Python 2.7.6: /usr/bin/pythonTue Jul 19 13:34:09 2016A problem occurred in a Python script. Here is the sequence offunction calls leading up to the error, in the order they occurred.

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py in plugin_create_port(self=<vnc_openstack.neutron_plugin_interface.NeutronPluginInterface object>, context={'is_admin': True, 'operation': 'CREATE', 'roles': ['_member_', 'admin'], 'tenant': 'b6f8236e9ce0476d8db0e6c53683b448', 'tenant_id': 'b6f8236e9ce0476d8db0e6c53683b448', 'type': 'port', 'user_id': '05fb5c8036e543a486819192f3ad44af'}, port={'fields': None, 'filters': None, 'resource': {'admin_state_up': True, 'binding:host_id': 'nodeb5', 'binding:vnic_type': 'normal', 'device_id': '3cad4cac-6750-477c-8b55-826ac90d069c', 'device_owner': 'compute:None', 'extra_dhcp_opts': None, 'fixed_ips': [{'ip_address': '10.100.0.1'}], 'name': u'', 'network_id': 'd82500ab-2319-4bb0-89b3-e375555d12a5', 'tenant_id': '1cd8f281255e4d1687ce42287febc9d0'}}) 379 try:
  380 cfgdb = self._get_user_cfgdb(context)
  381 net_info = cfgdb.port_create(context, port['resource'])
  382 return net_info
  383 except Exception as e:
net_info undefined
cfgdb = <vnc_openstack.neutron_plugin_db.DBInterface object>
cfgdb.port_create = <bound method DBInterface.wrapper of <vnc_openstack.neutron_plugin_db.DBInterface object>>
context = {'is_admin': True, 'operation': 'CREATE', 'roles': ['_member_', 'admin'], 'tenant': 'b6f8236e9ce0476d8db0e6c53683b448', 'tenant_id': 'b6f8236e9ce0476d8db0e6c53683b448', 'type': 'port', 'user_id': '05fb5c8036e543a486819192f3ad44af'}
port = {'fields': None, 'filters': None, 'resource': {'admin_state_up': True, 'binding:host_id': 'nodeb5', 'binding:vnic_type': 'normal', 'device_id': '3cad4cac-6750-477c-8b55-826ac90d069c', 'device_owner': 'compute:None', 'extra_dhcp_opts': None, 'fixed_ips': [{'ip_address': '10.100.0.1'}], 'name': u'', 'network_id': 'd82500ab-2319-4bb0-89b3-e375555d12a5', 'tenant_id': '1cd8f281255e4d1687ce42287febc9d0'}}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in wrapper(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, *args=({'is_admin': True, 'operation': 'CREATE', 'roles': ['_member_', 'admin'], 'tenant': 'b6f8236e9ce0476d8db0e6c53683b448', 'tenant_id': 'b6f8236e9ce0476d8db0e6c53683b448', 'type': 'port', 'user_id': '05fb5c8036e543a486819192f3ad44af'}, {'admin_state_up': True, 'binding:host_id': 'nodeb5', 'binding:vnic_type': 'normal', 'device_id': '3cad4cac-6750-477c-8b55-826ac90d069c', 'device_owner': 'compute:None', 'extra_dhcp_opts': None, 'fixed_ips': [{'ip_address': '10.100.0.1'}], 'name': u'', 'network_id': 'd82500ab-2319-4bb0-89b3-e375555d12a5', 'tenant_id': '1cd8f281255e4d1687ce42287febc9d0'}), **kwargs={})
 2331 def wrapper(self, *args, **kwargs):
 2332 self._connected_to_api_server.wait()
 2333 return func(self, *args, **kwargs)
 2334
 2335 return wrapper
func = <function port_create>
self = <vnc_openstack.neutron_plugin_db.DBInterface object>
args = ({'is_admin': True, 'operation': 'CREATE', 'roles': ['_member_', 'admin'], 'tenant': 'b6f8236e9ce0476d8db0e6c53683b448', 'tenant_id': 'b6f8236e9ce0476d8db0e6c53683b448', 'type': 'port', 'user_id': '05fb5c8036e543a486819192f3ad44af'}, {'admin_state_up': True, 'binding:host_id': 'nodeb5', 'binding:vnic_type': 'normal', 'device_id': '3cad4cac-6750-477c-8b55-826ac90d069c', 'device_owner': 'compute:None', 'extra_dhcp_opts': None, 'fixed_ips': [{'ip_address': '10.100.0.1'}], 'name': u'', 'network_id': 'd82500ab-2319-4bb0-89b3-e375555d12a5', 'tenant_id': '1cd8f281255e4d1687ce42287febc9d0'})
kwargs = {}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in port_create(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, context={'is_admin': True, 'operation': 'CREATE', 'roles': ['_member_', 'admin'], 'tenant': 'b6f8236e9ce0476d8db0e6c53683b448', 'tenant_id': 'b6f8236e9ce0476d8db0e6c53683b448', 'type': 'port', 'user_id': '05fb5c8036e543a486819192f3ad44af'}, port_q={'admin_state_up': True, 'binding:host_id': 'nodeb5', 'binding:vnic_type': 'normal', 'device_id': '3cad4cac-6750-477c-8b55-826ac90d069c', 'device_owner': 'compute:None', 'extra_dhcp_opts': None, 'fixed_ips': [{'ip_address': '10.100.0.1'}], 'name': u'', 'network_id': 'd82500ab-2319-4bb0-89b3-e375555d12a5', 'tenant_id': '1cd8f281255e4d1687ce42287febc9d0'})
 3565 try:
 3566 if 'fixed_ips' in port_q:
 3567 self._port_create_instance_ip(net_obj, port_obj, port_q)
 3568 elif net_obj.get_network_ipam_refs():
 3569 if (ip_obj_v4_create is True):
self = <vnc_openstack.neutron_plugin_db.DBInterface object>
self._port_create_instance_ip = <bound method DBInterface._port_create_instance_..._openstack.neutron_plugin_db.DBInterface object>>
net_obj = <vnc_api.gen.resource_client.VirtualNetwork object>
port_obj = <vnc_api.gen.resource_client.VirtualMachineInterface object>
port_q = {'admin_state_up': True, 'binding:host_id': 'nodeb5', 'binding:vnic_type': 'normal', 'device_id': '3cad4cac-6750-477c-8b55-826ac90d069c', 'device_owner': 'compute:None', 'extra_dhcp_opts': None, 'fixed_ips': [{'ip_address': '10.100.0.1'}], 'name': u'', 'network_id': 'd82500ab-2319-4bb0-89b3-e375555d12a5', 'tenant_id': '1cd8f281255e4d1687ce42287febc9d0'}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in _port_create_instance_ip(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, net_obj=<vnc_api.gen.resource_client.VirtualNetwork object>, port_obj=<vnc_api.gen.resource_client.VirtualMachineInterface object>, port_q={'admin_state_up': True, 'binding:host_id': 'nodeb5', 'binding:vnic_type': 'normal', 'device_id': '3cad4cac-6750-477c-8b55-826ac90d069c', 'device_owner': 'compute:None', 'extra_dhcp_opts': None, 'fixed_ips': [{'ip_address': '10.100.0.1'}], 'name': u'', 'network_id': 'd82500ab-2319-4bb0-89b3-e375555d12a5', 'tenant_id': '1cd8f281255e4d1687ce42287febc9d0'}, ip_family='v4')
 3511 subnet_id = fixed_ip.get('subnet_id')
 3512 ip_id = self._create_instance_ip(net_obj, port_obj, ip_addr,
 3513 subnet_id, ip_family)
 3514 created_iip_ids.append(ip_id)
 3515 except vnc_exc.HttpError as e:
subnet_id = None
ip_family = 'v4'

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in _create_instance_ip(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, net_obj=<vnc_api.gen.resource_client.VirtualNetwork object>, port_obj=<vnc_api.gen.resource_client.VirtualMachineInterface object>, ip_addr='10.100.0.1', subnet_uuid=None, ip_family='v4')
 3475 ip_obj.set_instance_ip_address(ip_addr)
 3476
 3477 ip_id = self._instance_ip_create(ip_obj)
 3478 return ip_id
 3479 # end _create_instance_ip
ip_id undefined
self = <vnc_openstack.neutron_plugin_db.DBInterface object>
self._instance_ip_create = <bound method DBInterface._instance_ip_create of..._openstack.neutron_plugin_db.DBInterface object>>
ip_obj = <vnc_api.gen.resource_client.InstanceIp object>

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in _instance_ip_create(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, iip_obj=<vnc_api.gen.resource_client.InstanceIp object>)
  382
  383 def _instance_ip_create(self, iip_obj):
  384 iip_uuid = self._vnc_lib.instance_ip_create(iip_obj)
  385
  386 return iip_uuid
iip_uuid undefined
self = <vnc_openstack.neutron_plugin_db.DBInterface object>
self._vnc_lib = <vnc_api.vnc_api.VncApi object>
self._vnc_lib.instance_ip_create = <functools.partial object>
iip_obj = <vnc_api.gen.resource_client.InstanceIp object>

 /usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py in wrapper(self=<vnc_api.vnc_api.VncApi object>, *args=('instance-ip', <vnc_api.gen.resource_client.InstanceIp object>), **kwargs={})
   37 retry_on_error=False)
   38 self._parse_homepage(homepage)
   39 return func(self, *args, **kwargs)
   40 return wrapper
   41
func = <function _object_create>
self = <vnc_api.vnc_api.VncApi object>
args = ('instance-ip', <vnc_api.gen.resource_client.InstanceIp object>)
kwargs = {}

 /usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py in _object_create(self=<vnc_api.vnc_api.VncApi object>, res_type='instance-ip', obj=<vnc_api.gen.resource_client.InstanceIp object>)
  351 content = self._request_server(rest.OP_POST,
  352 obj_cls.create_uri,
  353 data=json_body)
  354
  355 obj_dict = json.loads(content)[res_type]
data undefined
json_body = '{"instance-ip":{"fq_name": ["ef635f91-92df-4576-...ance_ip": false, "instance_ip_secondary": false}}'

 /usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py in _request_server(self=<vnc_api.vnc_api.VncApi object>, op=1, url=u'/instance-ips', data='{"instance-ip":{"fq_name": ["ef635f91-92df-4576-...ance_ip": false, "instance_ip_secondary": false}}', retry_on_error=True, retry_after_authn=False, retry_count=30)
  710 return self._request(op, url, data=data, retry_on_error=retry_on_error,
  711 retry_after_authn=retry_after_authn,
  712 retry_count=retry_count)
  713
  714 def _request(self, op, url, data=None, retry_on_error=True,
retry_count = 30
 /usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py in _request(self=<vnc_api.vnc_api.VncApi object>, op=1, url=u'/instance-ips', data='{"instance-ip":{"fq_name": ["ef635f91-92df-4576-...ance_ip": false, "instance_ip_secondary": false}}', retry_on_error=True, retry_after_authn=False, retry_count=30)
  753 % (op, url, data, content))
  754 elif status == 403:
  755 raise PermissionDenied(content)
  756 elif status == 409:
  757 raise RefsExistError(content)
global PermissionDenied = <class 'cfgm_common.exceptions.PermissionDenied'>
content = u'Gateway IP cannot be used by VM port'
<class 'cfgm_common.exceptions.PermissionDenied'>: Gateway IP cannot be used by VM port
    __class__ = <class 'cfgm_common.exceptions.PermissionDenied'>
    __delattr__ = <method-wrapper '__delattr__' of PermissionDenied object>
    __dict__ = {}
    __doc__ = None
    __format__ = <built-in method __format__ of PermissionDenied object>
    __getattribute__ = <method-wrapper '__getattribute__' of PermissionDenied object>
    __getitem__ = <method-wrapper '__getitem__' of PermissionDenied object>
    __getslice__ = <method-wrapper '__getslice__' of PermissionDenied object>
    __hash__ = <method-wrapper '__hash__' of PermissionDenied object>
    __init__ = <method-wrapper '__init__' of PermissionDenied object>
    __module__ = 'cfgm_common.exceptions'
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of PermissionDenied object>
    __reduce_ex__ = <built-in method __reduce_ex__ of PermissionDenied object>
    __repr__ = <method-wrapper '__repr__' of PermissionDenied object>
    __setattr__ = <method-wrapper '__setattr__' of PermissionDenied object>
    __setstate__ = <built-in method __setstate__ of PermissionDenied object>
    __sizeof__ = <built-in method __sizeof__ of PermissionDenied object>
    __str__ = <method-wrapper '__str__' of PermissionDenied object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of PermissionDenied object>
    __weakref__ = None
    args = (u'Gateway IP cannot be used by VM port',)
    message = u'Gateway IP cannot be used by VM port'

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/neutron_plugin_interface.py", line 381, in plugin_create_port
    net_info = cfgdb.port_create(context, port['resource'])
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 2333, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 3567, in port_create
    self._port_create_instance_ip(net_obj, port_obj, port_q)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 3513, in _port_create_instance_ip
    subnet_id, ip_family)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 3477, in _create_instance_ip
    ip_id = self._instance_ip_create(ip_obj)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 384, in _instance_ip_create
    iip_uuid = self._vnc_lib.instance_ip_create(iip_obj)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 39, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 353, in _object_create
    data=json_body)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 712, in _request_server
    retry_count=retry_count)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 755, in _request
    raise PermissionDenied(content)
PermissionDenied: Gateway IP cannot be used by VM port

Revision history for this message
Sachin Bansal (sbansal) wrote :

Attaching gateway ip to a VM cannot be allowed. We should skip this test or change it.

Changed in juniperopenstack:
status: New → Won't Fix
Revision history for this message
Vedamurthy Joshi (vedujoshi) wrote :

We should throw proper errors for these.. Error 500 is not right

Sachin Bansal (sbansal)
Changed in juniperopenstack:
assignee: Sachin Bansal (sbansal) → ssabharwal@juniper.net (ssabharwal)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.1

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

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

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

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

Review in progress for https://review.opencontrail.org/22525
Submitter: <email address hidden> (<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/22567
Submitter: Atul Moghe (<email address hidden>)

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

Review in progress for https://review.opencontrail.org/22525
Submitter: <email address hidden> (<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/22567
Submitter: Atul Moghe (<email address hidden>)

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

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

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

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

commit bb1c4e3ac1b75260bba5bad1c3cd83aa8d01188a
Author: Sahil Sabharwal <email address hidden>
Date: Wed Jul 27 19:45:42 2016 -0700

1.Modified vnc_openstack to catch proper error from the api-server and pass it to the neutron.
2.Added config option 'strict_compliance" for enabling port create of with IP of service address

Closes-Bug: 1604373
Closes-Bug: 1604556
Closes-Bug: 1604578
Closes-Bug: 1604935
Closes-Bug: 1604354
Change-Id: Ibd66e36d57a1079fb8a3032ea117d0a7c7f7b634
(cherry picked from commit 44c1853511982806d8ed144bf6ad266e5c9b6dfb)

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

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

commit 555039cf7aa212a80b4b4aef1b1954c763d69106
Author: Sahil Sabharwal <email address hidden>
Date: Wed Jul 27 19:45:42 2016 -0700

1.Modified vnc_openstack to catch proper error from the api-server and pass it to the neutron.
2.Added config option 'strict_compliance" for enabling port create of with IP of service address

Closes-Bug: 1604373
Closes-Bug: 1604556
Closes-Bug: 1604578
Closes-Bug: 1604935
Closes-Bug: 1604354
Change-Id: Ibd66e36d57a1079fb8a3032ea117d0a7c7f7b634
(cherry picked from commit 44c1853511982806d8ed144bf6ad266e5c9b6dfb)

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.