When port-limit is reached , a port-create causes internal server error

Bug #1354830 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R1.1
Won't Fix
High
Sachin Bansal
Trunk
Fix Committed
High
Sachin Bansal

Bug Description

When port-limit is reached, a port-create causes internal server instead of giving the right exception.

contrail-api log seems to indicate the right error message...but neutron shows internal server error :

root@nodec22:~# neutron port-create public_vn
Request Failed: internal server error while processing your request.
root@nodec22:~#

root@nodec22:~# neutron quota-show --tenant-id 3088e9aba97b4f2ea6050275fc890f5c
+---------------------+-------+
| Field | Value |
+---------------------+-------+
| floatingip | -1 |
| nat_instance | -1 |
| network | -1 |
| port | 1 |
| route_table | -1 |
| router | -1 |
| security_group | -1 |
| security_group_rule | -1 |
| subnet | -1 |
+---------------------+-------+
root@nodec22:~#

contrail-api log:
==============
<class 'cfgm_common.exceptions.PermissionDenied'>
Python 2.7.3: /usr/bin/python
Sun Aug 10 05:09:11 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.7/dist-packages/vnc_openstack/neutron_plugin_interface.py in plugin_create_port(self=<vnc_openstack.neutron_plugin_interface.NeutronPluginInterface object>, context={u'is_admin': True, u'operation': u'CREATE', u'roles': [u'_member_', u'admin'], u'tenant': u'41aed434c0e54dfbada529578ff39224', u'tenant_id': u'41aed434c0e54dfbada529578ff39224', u'type': u'port', u'user_id': u'f1bf306be7a94495a491d0e16999c102'}, port={u'fields': None, u'filters': None, u'resource': {u'admin_state_up': True, u'binding:host_id': u'nodeh5', u'device_id': u'b44a8d2d-510e-49c5-96db-3f5eaa81b0df', u'device_owner': u'compute:None', u'extra_dhcp_opts': None, u'name': u'', u'network_id': u'e376dbda-8ce7-40c8-983b-03beec6ae131', u'security_groups': [u'3619ff8e-a0d9-4529-9837-c087c723ae40'], u'tenant_id': u'3088e9aba97b4f2ea6050275fc890f5c'}})
  388 try:
  389 cfgdb = self._get_user_cfgdb(context)
  390 net_info = cfgdb.port_create(port['resource'])
  391 return net_info
  392 except Exception as e:
net_info undefined
cfgdb = <vnc_openstack.neutron_plugin_db.DBInterface object>
cfgdb.port_create = <bound method DBInterface.port_create of <vnc_openstack.neutron_plugin_db.DBInterface object>>
port = {u'fields': None, u'filters': None, u'resource': {u'admin_state_up': True, u'binding:host_id': u'nodeh5', u'device_id': u'b44a8d2d-510e-49c5-96db-3f5eaa81b0df', u'device_owner': u'compute:None', u'extra_dhcp_opts': None, u'name': u'', u'network_id': u'e376dbda-8ce7-40c8-983b-03beec6ae131', u'security_groups': [u'3619ff8e-a0d9-4529-9837-c087c723ae40'], u'tenant_id': u'3088e9aba97b4f2ea6050275fc890f5c'}}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in port_create(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, port_q={u'admin_state_up': True, u'binding:host_id': u'nodeh5', u'device_id': u'b44a8d2d-510e-49c5-96db-3f5eaa81b0df', u'device_owner': u'compute:None', u'extra_dhcp_opts': None, u'name': u'', u'network_id': u'e376dbda-8ce7-40c8-983b-03beec6ae131', u'security_groups': [u'3619ff8e-a0d9-4529-9837-c087c723ae40'], u'tenant_id': u'3088e9aba97b4f2ea6050275fc890f5c'})
 3355
 3356 # create the object
 3357 port_id = self._resource_create('virtual_machine_interface', port_obj)
 3358
 3359 # initialize ip object
port_id undefined
self = <vnc_openstack.neutron_plugin_db.DBInterface object>
self._resource_create = <bound method DBInterface._resource_create of <vnc_openstack.neutron_plugin_db.DBInterface object>>
port_obj = <vnc_api.gen.resource_client.VirtualMachineInterface object>

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in _resource_create(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, resource_type='virtual_machine_interface', obj=<vnc_api.gen.resource_client.VirtualMachineInterface object>)
  534 def _resource_create(self, resource_type, obj):
  535 try:
  536 obj_uuid = getattr(self._vnc_lib, resource_type + '_create')(obj)
  537 except RefsExistError:
  538 obj.uuid = str(uuid.uuid4())obj_uuid undefined
builtingetattr = <built-in function getattr>
self = <vnc_openstack.neutron_plugin_db.DBInterface object>
self._vnc_lib = <vnc_api.vnc_api.VncApi object>
resource_type = 'virtual_machine_interface'
obj = <vnc_api.gen.resource_client.VirtualMachineInterface object>

 /usr/lib/python2.7/dist-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...uuid": "b44a8d2d-510e-49c5-96db-3f5eaa81b0df"}]}}'

 /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'/virtual-machine-interfaces', data='{"virtual-machine-interface":{"fq_name": ["defau...uuid": "b44a8d2d-510e-49c5-96db-3f5eaa81b0df"}]}}', retry_on_error=True, retry_after_authn=False)
  346 % (op, url, data, content))
  347 elif status == 403:
  348 raise PermissionDenied(content)
  349 elif status == 409:
  350 raise RefsExistError(content)
global PermissionDenied = <class 'cfgm_common.exceptions.PermissionDenied'>
content = u"[u'default-domain', u'public', u'6668e474-efbc... exceeded for resource virtual-machine-interface"
<class 'cfgm_common.exceptions.PermissionDenied'>: [u'default-domain', u'public', u'6668e474-efbc-4e73-858f-d6dee2225ef1'] : quota limit (1) exceeded for resource virtual-machine-interface
    __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"[u'default-domain', u'public', u'6668e474-efbc... exceeded for resource virtual-machine-interface",)
    message = u"[u'default-domain', u'public', u'6668e474-efbc... exceeded for resource virtual-machine-interface"

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 390, in plugin_create_port
    net_info = cfgdb.port_create(port['resource'])
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 3357, in port_create
    port_id = self._resource_create('virtual_machine_interface', port_obj)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 536, in _resource_create
    obj_uuid = getattr(self._vnc_lib, resource_type + '_create')(obj)
  File "/usr/lib/python2.7/dist-packages/vnc_api/gen/vnc_api_client_gen.py", line 5444, in virtual_machine_interface_create
    data = json_body)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 348, in _request_server
    raise PermissionDenied(content)
PermissionDenied: [u'default-domain', u'public', u'6668e474-efbc-4e73-858f-d6dee2225ef1'] : quota limit (1) exceeded for resource virtual-machine-interface

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 764, in _handle
    return route.call(**args)
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 1575, in wrapper
    rv = callback(*a, **ka)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 465, in plugin_http_post_port
    return self.plugin_create_port(context, port)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 394, in plugin_create_port
    raise e
PermissionDenied: [u'default-domain', u'public', u'6668e474-efbc-4e73-858f-d6dee2225ef1'] : quota limit (1) exceeded for resource virtual-machine-interface
10.204.217.69 - - [2014-08-10 05:09:11] "POST /neutron/port HTTP/1.1" 500 156 0.095246
------------------------

2014-08-10 05:09:11.357 ERROR [neutron.api.v2.resource] create failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/neutron/api/v2/resource.py", line 84, in resource
    result = method(request=request, **args)
  File "/usr/lib/python2.7/dist-packages/neutron/api/v2/base.py", line 405, in create
    obj = obj_creator(request.context, **kwargs)
  File "/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/plugins/opencontrail/contrail_plugin_core.py", line 486, in create_port
    port = self._create_resource('port', context, port)
  File "/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/plugins/opencontrail/contrail_plugin_core.py", line 273, in _create_resource
    obj_name=res_type)
  File "/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/plugins/opencontrail/contrail_plugin_core.py", line 249, in _transform_response
    self._raise_contrail_error(status_code, info, obj_name)
  File "/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/plugins/opencontrail/contrail_plugin_core.py", line 255, in _raise_contrail_error
    error_class = CONTRAIL_EXCEPTION_MAP[status_code]
KeyError: 500

Sachin Bansal (sbansal)
Changed in juniperopenstack:
status: New → In Progress
Revision history for this message
Sachin Bansal (sbansal) wrote :
Changed in juniperopenstack:
status: In Progress → Fix Committed
Revision history for this message
Nagabhushana R (bhushana) wrote :

per vedu it is needed for 1.1 as well, could you update if this is checked in into R1.1 branch as well.

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.