← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1430541] Re: Neutron client expects a VALUE for all TYPEs when creating a neutron lbaas pool with session persistence

 

** Also affects: python-neutronclient
   Importance: Undecided
       Status: New

** Changed in: python-neutronclient
     Assignee: (unassigned) => Kyle Mestery (mestery)

** Changed in: python-neutronclient
     Assignee: Kyle Mestery (mestery) => Phillip Toohill (phillip-toohill)

** Changed in: python-neutronclient
    Milestone: None => 2.3.12

** Changed in: python-neutronclient
   Importance: Undecided => Low

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

Title:
  Neutron client expects a VALUE for all TYPEs when creating a neutron
  lbaas pool  with session persistence

Status in OpenStack Neutron (virtual network service):
  Fix Committed
Status in Python client library for Neutron:
  New

Bug description:
  When creating a neutron lbaas pool with session persistence TYPE as "HTTP_COOKIE" or "SOURCE_IP" the VALUE field is not expected by the neutron server.
  1. If not given a VALUE, the client throws "the format expected is <TYPE>:<VALUE>" error.
  2. If given a VALUE, the server throws an internal server error.
  3. And in cases like this we should expect a 400 error instead of a 500 internal server error.

  I have pasted below the detailed log of the 2 different scenarios
  using HTTP_COOKIE.

  Case 1: If VALUE not given:
  -----------------------------------------
  kilo1@ubuntu:/opt/stack/neutron-lbaas/neutron_lbaas$ neutron -v lbaas-pool-create --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP pool1 --session-persistence HTTP_COOKIE

  DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/opt/stack/data/CA/int-ca/ca-chain.pem" -X GET http://10.0.2.15:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
  DEBUG: urllib3.util.retry Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=0)
  DEBUG: keystoneclient.session RESP: [200] content-length: 335 vary: X-Auth-Token server: Apache/2.4.7 (Ubuntu) date: Tue, 10 Mar 2015 01:39:51 GMT content-type: application/json x-openstack-request-id: req-40f09f7e-97a2-46b2-ad91-c952abf2c3bc
  RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://10.0.2.15:5000/v2.0/";, "rel": "self"}, {"href": "http://docs.openstack.org/";, "type": "text/html", "rel": "describedby"}]}}

  DEBUG: stevedore.extension found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('shell = cliff.formatters.shell:ShellFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('value = cliff.formatters.value:ValueFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('yaml = clifftablib.formatters:YamlFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('json = clifftablib.formatters:JsonFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('html = clifftablib.formatters:HtmlFormatter')
  DEBUG: neutronclient.neutron.v2_0.lb.v2.pool.CreatePool get_data(Namespace(admin_state=True, columns=[], description=None, formatter='table', healthmonitor_id=None, lb_algorithm=u'ROUND_ROBIN', listener=u'listener1', max_width=0, name=u'pool1', prefix='', protocol=u'HTTP', request_format='json', session_persistence=u'HTTP_COOKIE', tenant_id=None, variables=[]))
  DEBUG: keystoneclient.auth.identity.v2 Making authentication request to http://10.0.2.15:5000/v2.0/tokens
  DEBUG: urllib3.util.retry Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=0)
  ERROR: neutronclient.shell Incorrect --session-persistence format. Format is <TYPE>:<VALUE>
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 731, in run_subcommand
      return run_command(cmd, cmd_parser, sub_argv)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 97, in run_command
      return cmd.run(known_args)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/common/command.py", line 29, in run
      return super(OpenStackCommand, self).run(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 91, in run
      column_names, data = self.take_action(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/common/command.py", line 35, in take_action
      return self.get_data(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 468, in get_data
      body = self.args2body(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/lb/v2/pool.py", line 105, in args2body
      parsed_args.session_persistence = _parse_persistence(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/lb/v2/pool.py", line 32, in _parse_persistence
      raise exceptions.CommandError('Incorrect --session-persistence'
  CommandError: Incorrect --session-persistence format. Format is <TYPE>:<VALUE>
  Incorrect --session-persistence format. Format is <TYPE>:<VALUE>

  =========================================================================================================

  case 2: If VALUE is given
  ----------------------------------------------

  kilo1@ubuntu:/opt/stack/neutron-lbaas/neutron_lbaas$ neutron -v lbaas-
  pool-create --lb-algorithm ROUND_ROBIN --listener listener1 --protocol
  HTTP pool1 --session-persistence HTTP_COOKIE:mycookie

  DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/opt/stack/data/CA/int-ca/ca-chain.pem" -X GET http://10.0.2.15:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
  DEBUG: urllib3.util.retry Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=0)
  DEBUG: keystoneclient.session RESP: [200] content-length: 335 vary: X-Auth-Token server: Apache/2.4.7 (Ubuntu) date: Tue, 10 Mar 2015 01:46:23 GMT content-type: application/json x-openstack-request-id: req-99a4800d-2df3-40a4-baf5-ae3e81cff817
  RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://10.0.2.15:5000/v2.0/";, "rel": "self"}, {"href": "http://docs.openstack.org/";, "type": "text/html", "rel": "describedby"}]}}

  DEBUG: stevedore.extension found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('shell = cliff.formatters.shell:ShellFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('value = cliff.formatters.value:ValueFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('yaml = clifftablib.formatters:YamlFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('json = clifftablib.formatters:JsonFormatter')
  DEBUG: stevedore.extension found extension EntryPoint.parse('html = clifftablib.formatters:HtmlFormatter')
  DEBUG: neutronclient.neutron.v2_0.lb.v2.pool.CreatePool get_data(Namespace(admin_state=True, columns=[], description=None, formatter='table', healthmonitor_id=None, lb_algorithm=u'ROUND_ROBIN', listener=u'listener1', max_width=0, name=u'pool1', prefix='', protocol=u'HTTP', request_format='json', session_persistence=u'HTTP_COOKIE:mycookie', tenant_id=None, variables=[]))
  DEBUG: keystoneclient.auth.identity.v2 Making authentication request to http://10.0.2.15:5000/v2.0/tokens
  DEBUG: urllib3.util.retry Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=0)
  DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/opt/stack/data/CA/int-ca/ca-chain.pem" -X GET http://10.0.2.15:9696/v2.0/lbaas/listeners.json?fields=id&name=listener1 -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}66ce0932b821acd556dea4d97310a5a376a216cc"
  DEBUG: urllib3.util.retry Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=0)
  DEBUG: keystoneclient.session RESP: [200] date: Tue, 10 Mar 2015 01:46:24 GMT content-length: 284 content-type: application/json; charset=UTF-8 x-openstack-request-id: req-fc117ddd-815d-4998-946a-75576f5697d7
  RESP BODY: {"listeners": [{"protocol_port": 80, "protocol": "HTTP", "description": "", "admin_state_up": true, "loadbalancers": [{"id": "49d89086-6b0f-4c53-90e8-a78733b67b0b"}], "connection_limit": -1, "default_pool_id": null, "id": "99175404-dc9a-4ad0-85b6-f348d7321457", "name": "listener1"}]}

  DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/opt/stack/data/CA/int-ca/ca-chain.pem" -X POST http://10.0.2.15:9696/v2.0/lbaas/pools.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}66ce0932b821acd556dea4d97310a5a376a216cc" -d '{"pool": {"lb_algorithm": "ROUND_ROBIN", "protocol": "HTTP", "name": "pool1", "admin_state_up": true, "listener_id": "99175404-dc9a-4ad0-85b6-f348d7321457", "session_persistence": {"cookie_name": "mycookie", "type": "HTTP_COOKIE"}}}'
  DEBUG: urllib3.util.retry Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=0)
  DEBUG: keystoneclient.session RESP:
  DEBUG: neutronclient.v2_0.client Error message: {"NeutronError": {"message": "Request Failed: internal server error while processing your request.", "type": "HTTPInternalServerError", "detail": ""}}
  ERROR: neutronclient.shell Request Failed: internal server error while processing your request.
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 731, in run_subcommand
      return run_command(cmd, cmd_parser, sub_argv)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 97, in run_command
      return cmd.run(known_args)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/common/command.py", line 29, in run
      return super(OpenStackCommand, self).run(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 91, in run
      column_names, data = self.take_action(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/common/command.py", line 35, in take_action
      return self.get_data(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 475, in get_data
      data = obj_creator(body)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 99, in with_params
      ret = self.function(instance, *args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 886, in create_lbaas_pool
      return self.post(self.lbaas_pools_path, body=body)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 295, in post
      headers=headers, params=params)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 208, in do_request
      self._handle_fault_response(status_code, replybody)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 182, in _handle_fault_response
      exception_handler_v20(status_code, des_error_body)
    File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 67, in exception_handler_v20
      status_code=status_code)
  InternalServerError: Request Failed: internal server error while processing your request.

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


References