Neutron-LBaaS v2: Specifying a large connection limit throws 500 on update listener

Bug #1570583 reported by Franklin Naval
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Expired
Low
Unassigned

Bug Description

1. Create a lb.
2. Create a listener.
3. Update the listener with a large connection limit, e.g. 9999999999

Result: 500 from the server is returned
Expected: Should return with 400 HTTPBadRequest similar to when specifying a connection limit less than -1
(ex: "NeutronError": {"message": "Invalid input for connection_limit. Reason: '-100' is not a valid value, because it cannot be less than -1.", "type": "HTTPBadRequest", "detail": ""}})

Logs:

neutron_lbaas.tests.tempest.v2.api.test_listeners_admin.ListenersTestAdmin.test_update_listener_connection_limit[smoke]
-----------------------------------------------------------------------------------------------------------------------

Captured pythonlogging:
~~~~~~~~~~~~~~~~~~~~~~~
    2016-04-14 20:20:24,757 32411 INFO [tempest.lib.common.rest_client] Request (ListenersTestAdmin:test_update_listener_connection_limit): 500 PUT http://127.0.0.1:9696/v2.0/lbaas/listeners/2676ca98-1ce0-41cc-a23d-ce5d6f96f991 0.632s
    2016-04-14 20:20:24,758 32411 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
            Body: {"listener": {"connection_limit": 9999999999}}
        Response - Headers: {'date': 'Thu, 14 Apr 2016 20:20:24 GMT', 'content-type': 'application/json', 'x-openstack-request-id': 'req-5e0a6948-0242-41ab-9ef4-71ab0866841f', 'status': '500', 'connection': 'close', 'content-length': '150'}
            Body: {"NeutronError": {"message": "Request Failed: internal server error while processing your request.", "type": "HTTPInternalServerError", "detail": ""}}
    2016-04-14 20:20:24,760 32411 INFO [neutron_lbaas.tests.tempest.v2.api.test_listeners_admin:ListenersTestAdmin] Finished: test_update_listener_connection_limit

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "neutron_lbaas/tests/tempest/v2/api/test_listeners_admin.py", line 170, in test_update_listener_connection_limit
        self._check_status_tree(load_balancer_id=self.load_balancer_id,
      File "neutron_lbaas/tests/tempest/v2/api/base.py", line 228, in _update_listener
        listener_id, **listener_kwargs)
      File "neutron_lbaas/tests/tempest/v2/clients/listeners_client.py", line 57, in update_listener
        .format(listener_id), put_body)
      File "/opt/stack/neutron-lbaas/.tox/apiv2/local/lib/python2.7/site-packages/tempest/lib/common/rest_client.py", line 322, in put
        return self.request('PUT', url, extra_headers, headers, body)
      File "/opt/stack/neutron-lbaas/.tox/apiv2/local/lib/python2.7/site-packages/tempest/lib/common/rest_client.py", line 642, in request
        resp, resp_body)
      File "/opt/stack/neutron-lbaas/.tox/apiv2/local/lib/python2.7/site-packages/tempest/lib/common/rest_client.py", line 761, in _error_checker
        message=message)
    tempest.lib.exceptions.ServerFault: Got server fault
    Details: Request Failed: internal server error while processing your request.

Changed in neutron:
importance: Undecided → Low
Revision history for this message
Brandon Logan (brandon-logan) wrote :

this is because the validation for this only checks a min value and not a max value. Any max value is allowed and it passes to the database for insertion. The database has a 32-bit int type for the column, so large numbers will fail.

The correct solution to this is to just modify the validation to the API to check a max value. The database should column type should not be changed.

Changed in neutron:
status: New → Triaged
Chetna (ck-khullar)
Changed in neutron:
assignee: nobody → Chetna (ck-khullar)
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This bug is > 180 days without activity. We are unsetting assignee and milestone and setting status to Incomplete in order to allow its expiry in 60 days.

If the bug is still valid, then update the bug status.

Changed in neutron:
assignee: Chetna (ck-khullar) → nobody
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
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.