← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1413847] [NEW] Neutron client return 400 when request uri is too long

 

Public bug reported:

When I get security group rule by  admin, neutron client return 400:

 ERROR: neutronclient.shell <html><body><h1>400 Bad request</h1>
Your browser sent an invalid request.
</body></html>
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/neutronclient/shell.py", line 554, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/usr/lib/python2.6/site-packages/neutronclient/shell.py", line 83, in run_command
    return cmd.run(known_args)
  File "/usr/lib/python2.6/site-packages/neutronclient/common/command.py", line 34, in run
    return super(OpenStackCommand, self).run(parsed_args)
  File "/usr/lib/python2.6/site-packages/cliff/display.py", line 84, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/lib/python2.6/site-packages/neutronclient/common/command.py", line 40, in take_action
    return self.get_data(parsed_args)
  File "/usr/lib/python2.6/site-packages/neutronclient/neutron/v2_0/__init__.py", line 615, in get_data
    self.extend_list(data, parsed_args)
  File "/usr/lib/python2.6/site-packages/neutronclient/neutron/v2_0/securitygroup.py", line 171, in extend_list
    _get_sec_group_list(sec_group_ids[i: i + chunk_size]))
  File "/usr/lib/python2.6/site-packages/neutronclient/neutron/v2_0/securitygroup.py", line 153, in _get_sec_group_list
    **search_opts).get('security_groups', [])
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 101, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 476, in list_security_groups
    retrieve_all, **_params)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1330, in list
    for r in self._pagination(collection, path, **params):
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1343, in _pagination
    res = self.get(path, params=params)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1316, in get
    headers=headers, params=params)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1301, in retry_request
    headers=headers, params=params)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1244, in do_request
    self._handle_fault_response(status_code, replybody)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1211, in _handle_fault_response
    exception_handler_v20(status_code, des_error_body)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 81, in exception_handler_v20
    message=message)
NeutronClientException: <html><body><h1>400 Bad request</h1>
Your browser sent an invalid request.
</body></html>

I have print the uri len, it's larger than the default max uri len for eventlet.wsgi.server.
In the neutron client code, it had  split the security-groups ids list, so the uri len is less than 8192. (In my environment, after split uri_len is 8159)

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1413847

Title:
  Neutron client return 400 when request uri is too long

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  When I get security group rule by  admin, neutron client return 400:

   ERROR: neutronclient.shell <html><body><h1>400 Bad request</h1>
  Your browser sent an invalid request.
  </body></html>
  Traceback (most recent call last):
    File "/usr/lib/python2.6/site-packages/neutronclient/shell.py", line 554, in run_subcommand
      return run_command(cmd, cmd_parser, sub_argv)
    File "/usr/lib/python2.6/site-packages/neutronclient/shell.py", line 83, in run_command
      return cmd.run(known_args)
    File "/usr/lib/python2.6/site-packages/neutronclient/common/command.py", line 34, in run
      return super(OpenStackCommand, self).run(parsed_args)
    File "/usr/lib/python2.6/site-packages/cliff/display.py", line 84, in run
      column_names, data = self.take_action(parsed_args)
    File "/usr/lib/python2.6/site-packages/neutronclient/common/command.py", line 40, in take_action
      return self.get_data(parsed_args)
    File "/usr/lib/python2.6/site-packages/neutronclient/neutron/v2_0/__init__.py", line 615, in get_data
      self.extend_list(data, parsed_args)
    File "/usr/lib/python2.6/site-packages/neutronclient/neutron/v2_0/securitygroup.py", line 171, in extend_list
      _get_sec_group_list(sec_group_ids[i: i + chunk_size]))
    File "/usr/lib/python2.6/site-packages/neutronclient/neutron/v2_0/securitygroup.py", line 153, in _get_sec_group_list
      **search_opts).get('security_groups', [])
    File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 101, in with_params
      ret = self.function(instance, *args, **kwargs)
    File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 476, in list_security_groups
      retrieve_all, **_params)
    File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1330, in list
      for r in self._pagination(collection, path, **params):
    File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1343, in _pagination
      res = self.get(path, params=params)
    File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1316, in get
      headers=headers, params=params)
    File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1301, in retry_request
      headers=headers, params=params)
    File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1244, in do_request
      self._handle_fault_response(status_code, replybody)
    File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1211, in _handle_fault_response
      exception_handler_v20(status_code, des_error_body)
    File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 81, in exception_handler_v20
      message=message)
  NeutronClientException: <html><body><h1>400 Bad request</h1>
  Your browser sent an invalid request.
  </body></html>

  I have print the uri len, it's larger than the default max uri len for eventlet.wsgi.server.
  In the neutron client code, it had  split the security-groups ids list, so the uri len is less than 8192. (In my environment, after split uri_len is 8159)

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1413847/+subscriptions


Follow ups

References