neutron-lbaas v2 - update pool's session_persistence to None fails

Bug #1577987 reported by Madhusudhan Kandadai
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Franklin Naval

Bug Description

When updating a pool's session_persistence to None, I get the following error: Invalid input for session_persistence

1. Create a loadbalancer, listener

2. Create a pool with default args:

using postman:

{
    "pool": {
        "name": "pool1",
        "description": "simple pool",
        "listener_id": "39de4d56-d663-46e5-85a1-5b9d5fa17829",
        "lb_algorithm": "ROUND_ROBIN",
        "protocol": "HTTP",
        "session_persistence": {
            "type": "APP_COOKIE",
            "cookie_name": "my_cookie"
        },
        "admin_state_up": true
    }
}

Update pool with below data:

{
    "pool": {
        "session_persistence": {"type": ""}
    }
}

neutron-server logs:

2016-05-03 16:39:54.698 DEBUG neutron.wsgi [-] (66382) accepted ('192.168.109.128', 58400) from (pid=66382) server /usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py:867
2016-05-03 16:39:55.025 DEBUG neutron.api.v2.base [req-78bc175f-374d-403c-b5a5-845d4bc79632 admin be81e9163d074036913aa52b1b9785a7] Request body: {u'pool': {u'session_persistence': {u'type': u''}}} from (pid=66382) prepare_request_body /opt/stack/neutron/neutron/api/v2/base.py:658
2016-05-03 16:39:55.025 DEBUG neutron_lib.api.validators [req-78bc175f-374d-403c-b5a5-845d4bc79632 admin be81e9163d074036913aa52b1b9785a7] ' ' is not in ('SOURCE_IP', 'HTTP_COOKIE', 'APP_COOKIE') from (pid=66382) validate_values /usr/local/lib/python2.7/dist-packages/neutron_lib/api/validators.py:91
2016-05-03 16:39:55.026 INFO neutron.api.v2.resource [req-78bc175f-374d-403c-b5a5-845d4bc79632 admin be81e9163d074036913aa52b1b9785a7] update failed (client error): Invalid input for session_persistence. Reason: '' is not in ('SOURCE_IP', 'HTTP_COOKIE', 'APP_COOKIE').
2016-05-03 16:39:55.027 INFO neutron.wsgi [req-78bc175f-374d-403c-b5a5-845d4bc79632 admin be81e9163d074036913aa52b1b9785a7] 192.168.109.128 - - [03/May/2016 16:39:55] "PUT /v2.0/lbaas/pools/aa341feb-ff6f-4d87-a613-52812c665bc0 HTTP/1.1" 400 400 0.327893

using CLI:

neutron lbaas-pool-update pool1 --session_persistence type=dict type=none
Invalid input for session_persistence. Reason: 'none' is not in ('SOURCE_IP', 'HTTP_COOKIE', 'APP_COOKIE').
Neutron server returns request_ids: ['req-93cc8a21-4243-4498-899c-fc9646cddb71']

neutron-server logs:

2016-05-03 16:41:31.834 DEBUG neutron_lbaas.drivers.octavia.octavia_messaging_consumer [-] Received event from stream {u'info_type': u'listener_stats', u'info_id': u'04c16cac-b748-47a6-975f-b109bd80a419', u'info_payload': {u'bytes_in': 0, u'total_connections': 0, u'active_connections': 0, u'bytes_out': 0}} from (pid=66202) update_info /opt/stack/neutron-lbaas/neutron_lbaas/drivers/octavia/octavia_messaging_consumer.py:74
2016-05-03 16:41:34.571 DEBUG neutron.wsgi [-] (66383) accepted ('192.168.109.128', 59130) from (pid=66383) server /usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py:867
2016-05-03 16:41:35.079 INFO neutron.wsgi [req-695f0831-c84d-43b3-ae37-764cd4a4fd9c admin be81e9163d074036913aa52b1b9785a7] 192.168.109.128 - - [03/May/2016 16:41:35] "GET /v2.0/lbaas/pools.json?fields=id&name=pool1 HTTP/1.1" 200 607 0.506676
2016-05-03 16:41:35.333 DEBUG neutron.api.v2.base [req-93cc8a21-4243-4498-899c-fc9646cddb71 admin be81e9163d074036913aa52b1b9785a7] Request body: {u'pool': {u'session_persistence': {u'type': u'none'}}} from (pid=66383) prepare_request_body /opt/stack/neutron/neutron/api/v2/base.py:658
2016-05-03 16:41:35.335 DEBUG neutron_lib.api.validators [req-93cc8a21-4243-4498-899c-fc9646cddb71 admin be81e9163d074036913aa52b1b9785a7] 'none' is not in ('SOURCE_IP', 'HTTP_COOKIE', 'APP_COOKIE') from (pid=66383) validate_values /usr/local/lib/python2.7/dist-packages/neutron_lib/api/validators.py:91
2016-05-03 16:41:35.336 INFO neutron.api.v2.resource [req-93cc8a21-4243-4498-899c-fc9646cddb71 admin be81e9163d074036913aa52b1b9785a7] update failed (client error): Invalid input for session_persistence. Reason: 'none' is not in ('SOURCE_IP', 'HTTP_COOKIE', 'APP_COOKIE').
2016-05-03 16:41:35.342 INFO neutron.wsgi [req-93cc8a21-4243-4498-899c-fc9646cddb71 admin be81e9163d074036913aa52b1b9785a7] 192.168.109.128 - - [03/May/2016 16:41:35] "PUT /v2.0/lbaas/pools/aa341feb-ff6f-4d87-a613-52812c665bc0.json HTTP/1.1" 400 403 0.258400
2016-05-03 16:41:36.258 DEBUG oslo_messaging._drivers.amqpdriver [-] received message msg_id: None reply to None from (pid=66384) __call__ /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py:201

Tags: lbaas
Revision history for this message
Ryan Moats (rmoats) wrote :

Brandon, can you please take a look? thanx

Changed in neutron:
assignee: nobody → Brandon Logan (brandon-logan)
Revision history for this message
Franklin Naval (franknaval) wrote :

This also happens with setting persistence type to None.

https://gist.github.com/fnaval/bfcd8be0773098b2fec1acf02fb95bc4

Revision history for this message
Franklin Naval (franknaval) wrote :

for reference, this PR should have fixed it:
https://review.openstack.org/#/c/287004/

Revision history for this message
Brandon Logan (brandon-logan) wrote :

if in json you did:

{"pool": {"session_persistence": null}}

that should give you what you want.

Changed in neutron:
status: New → Invalid
Changed in neutron:
assignee: Brandon Logan (brandon-logan) → Franklin Naval (franknaval)
status: Invalid → In Progress
Revision history for this message
Brandon Logan (brandon-logan) wrote :

this is just a bug with tempest tests

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lbaas (master)

Reviewed: https://review.openstack.org/314340
Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=afe44a2d560c73ea6a166aa53d974d98b301a5d0
Submitter: Jenkins
Branch: master

commit afe44a2d560c73ea6a166aa53d974d98b301a5d0
Author: Franklin Naval <email address hidden>
Date: Mon May 9 19:16:03 2016 -0500

    Neutron_LBaaSv2: Update Session Persistence Bug

    * fixes the intermittent failures seen in the
      session persistence scenario test; the update method
      in the test was not explictly setting session
      persistence to None when removing an already
      set session persistence object

    Change-Id: Ib78a6d4c08912d960ac4e916c338a7b2b3707c33
    Closes-Bug: #1577987

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron-lbaas 9.0.0.0b1

This issue was fixed in the openstack/neutron-lbaas 9.0.0.0b1 development milestone.

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.