When quota-limit is reached for subnets/vn, internal server error is seen

Bug #1363718 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Incomplete
High
Vedamurthy Joshi
R1.1
Incomplete
High
Vedamurthy Joshi

Bug Description

R1.10 28

When in a custom project, I edit contrail-api.conf with below and restarted contrail-api:
[QUOTA]
subnet=2
virtual-network=2

root@nodea9:~# neutron quota-show
+---------------------+-------+
| Field | Value |
+---------------------+-------+
| floatingip | -1 |
| nat_instance | -1 |
| network | 2 |
| port | -1 |
| route_table | -1 |
| router | -1 |
| security_group | -1 |
| security_group_rule | -1 |
| subnet | 2 |
+---------------------+-------+
root@nodea9:~#

Then, i tried to create 3 networks (net1,net2,net3)... on creating net3, we get internal server error.
Same error when subnet limits are reached

<class 'cfgm_common.exceptions.HttpError'>
Python 2.7.3: /usr/bin/python
Mon Sep 1 00:55:04 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_network(self=<vnc_openstack.neutron_plugin_interface.NeutronPluginInterface object>, context={u'is_admin': False, u'operation': u'CREATE', u'roles': [u'_member_', u'Member'], u'tenant': u'4c935d93d292469c8fce8c40639f8705', u'tenant_id': u'4c935d93d292469c8fce8c40639f8705', u'type': u'network', u'user_id': u'b718482cfb314144894764a0dffd62e8'}, network={u'fields': None, u'filters': None, u'resource': {u'admin_state_up': True, u'contrail:policys': u'', u'name': u'net3', u'port_security_enabled': True, u'shared': False, u'tenant_id': u'4c935d93d292469c8fce8c40639f8705', u'vpc:route_table': u''}})
  134 try:
  135 cfgdb = self._get_user_cfgdb(context)
  136 net_info = cfgdb.network_create(network['resource'])
  137 return net_info
  138 except Exception as e:
net_info undefined
cfgdb = <vnc_openstack.neutron_plugin_db.DBInterface object>
cfgdb.network_create = <bound method DBInterface.network_create of <vnc_openstack.neutron_plugin_db.DBInterface object>>
network = {u'fields': None, u'filters': None, u'resource': {u'admin_state_up': True, u'contrail:policys': u'', u'name': u'net3', u'port_security_enabled': True, u'shared': False, u'tenant_id': u'4c935d93d292469c8fce8c40639f8705', u'vpc:route_table': u''}}

 /usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py in network_create(self=<vnc_openstack.neutron_plugin_db.DBInterface object>, network_q={u'admin_state_up': True, u'contrail:policys': u'', u'name': u'net3', u'port_security_enabled': True, u'shared': False, u'tenant_id': u'4c935d93d292469c8fce8c40639f8705', u'vpc:route_table': u''})
 2262 net_obj = self._network_neutron_to_vnc(network_q, CREATE)
 2263 try:
 2264 net_uuid = self._resource_create('virtual_network', net_obj)
 2265 except RefsExistError:
 2266 self._raise_contrail_exception(400, exceptions.BadRequest(
net_uuid 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>>
net_obj = <vnc_api.gen.resource_client.VirtualNetwork 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_network', obj=<vnc_api.gen.resource_client.VirtualNetwork object>)
  562 def _resource_create(self, resource_type, obj):
  563 try:
  564 obj_uuid = getattr(self._vnc_lib, resource_type + '_create')(obj)
  565 except RefsExistError:
  566 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_network'
obj = <vnc_api.gen.resource_client.VirtualNetwork object>

 /usr/lib/python2.7/dist-packages/vnc_api/gen/vnc_api_client_gen.py in virtual_network_create(self=<vnc_api.vnc_api.VncApi object>, obj=<vnc_api.gen.resource_client.VirtualNetwork object>)
 4790 content = self._request_server(rest.OP_POST,
 4791 vnc_api.gen.resource_client.VirtualNetwork.create_uri,
 4792 data = json_body)
 4793
 4794 virtual_network_dict = json.loads(content)['virtual-network']
data undefined
json_body = '{"virtual-network":{"fq_name": ["default-domain"...ll}, "display_name": "net3", "is_shared": 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'/virtual-networks', data='{"virtual-network":{"fq_name": ["default-domain"...ll}, "display_name": "net3", "is_shared": false}}', retry_on_error=True, retry_after_authn=False)
  365 continue
  366 else: # Unknown Error
  367 raise HttpError(status, content)
  368 # end while True
  369
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>
    __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.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 136, in plugin_create_network
    net_info = cfgdb.network_create(network['resource'])
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 2264, in network_create
    net_uuid = self._resource_create('virtual_network', net_obj)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 564, 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 4792, in virtual_network_create
    data = json_body)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 367, in _request_server
    raise HttpError(status, content)
HttpError: HTTP Status: 500 Content: Internal Server Error

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 211, in plugin_http_post_network
    return self.plugin_create_network(context, network)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 140, in plugin_create_network
    raise e
HttpError: HTTP Status: 500 Content: Internal Server Error
10.204.216.47 - - [2014-09-01 00:55:04] "POST /neutron/network HTTP/1.1" 500 156 0.028547

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

I tried on build 31 and it is working correctly for me:

root@a6s21:~# neutron net-create n3
400-{u'NeutronError': {u'message': u"[u'default-domain', u'admin', u'n3'] : quota limit (2) exceeded for resource virtual-network", u'type': u'ContrailBadRequestError', u'detail': u''}}

Please provide contrail-api-0.log if you are still seeing internal server error.

Sachin Bansal (sbansal)
Changed in juniperopenstack:
status: New → Incomplete
Sachin Bansal (sbansal)
Changed in juniperopenstack:
assignee: Sachin Bansal (sbansal) → Vedamurthy Joshi (vedujoshi)
tags: removed: blocker
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.