Exception when editing a Load balancer VIP if session_persistence attr is not specified

Bug #1231704 reported by Kaiwei Fan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Akihiro Motoki

Bug Description

When editing a VIP that has no session_persistence configured, following exception occurred:

Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  115. response = callback(request, *callback_args, **callback_kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  54. return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  86. return view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view
  68. return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch
  86. return handler(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/edit.py" in get
  154. form = self.get_form(form_class)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/forms/views.py" in get_form
  87. return form_class(self.request, **self.get_form_kwargs())
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/edit.py" in get_form_kwargs
  41. kwargs = {'initial': self.get_initial()}
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/loadbalancers/views.py" in get_initial
  213. stype = vip['session_persistence']
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/base.py" in __getitem__
  126. raise KeyError(e)

Exception Type: KeyError at /project/loadbalancers/updatevip/a54f9221-7386-424b-9790-23a3cf1b4b03/
Exception Value: AttributeError('Unknown attribute "session_persistence" on APIResource object of type "<class \'openstack_dashboard.api.lbaas.Vip\'>"',)

Tags: lbaas
Revision history for this message
Akihiro Motoki (amotoki) wrote :

I am not sure this is a horizon bug or neutron bug.

In the current implementation, when session_persistence is not specified, neutron returns a VIP without 'session_persistence' attribute. 'session_persistence' is declared as visible in extensions/loadbalancer.py.

My question is Neutron should returns a attribute even when the attribute is NULL or empty or Neutron MAY omit such attribute in the response. IMO, all visible attributes should exist in the response.

summary: - Exception when editing a Load balancer VIP
+ Exception when editing a Load balancer VIP if session_persistence attr
+ is not specified
Revision history for this message
Akihiro Motoki (amotoki) wrote :

After asking Eugene, the leader of LBaaS subteam, I understand no session_persistence is also valid and it means there is actually no session persistence.

Horizon need to deal with the case where session_persistence does not exists in a response from Neutron.

Note that it is an undocumented behavior and i filed a bug in netconn-api.
https://bugs.launchpad.net/openstack-api-site/+bug/1231905

Changed in horizon:
assignee: nobody → Akihiro Motoki (amotoki)
importance: Undecided → Medium
milestone: none → havana-rc1
tags: added: lbaas
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Regarding Neutron behavior and API spec, I think it is better to be discussed in other thread.
I files a bug 1231915 to discuss it.

no longer affects: neutron
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/48634

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/48634
Committed: http://github.com/openstack/horizon/commit/445cd5e47d5684124a98360ab74db9c35ee09b7d
Submitter: Jenkins
Branch: master

commit 445cd5e47d5684124a98360ab74db9c35ee09b7d
Author: Akihiro MOTOKI <email address hidden>
Date: Fri Sep 27 20:56:44 2013 +0900

    Handle case without session_persistence attr in LBaaS VIP

    When no session persistence mechanism is used, session_persistence
    attribute is not contained in a VIP dict returned from Neutron.
    This commit add a logic to handle this case.

    During the fix it turns out the current LBaaS Horizon support
    does not consider a case of "No Session Persistence".
    This commit fixes the following too:

    * Display "None" in VIP detail (instead of "Type:" without a value)
    * Add "No session persistence" choice to VIP creation workflow
      (Actually it replaces "Select session persistence" choice
       since "No session persistence" is the default value.)

    This commit also fixes bugs related to LBaaS VIP:

    * Add validation for Cookie Name for APP_COOKIE persistence
      in VIP update. (The same is done for VIP creation)
    * Do not create a hyperlink if no VIP exist for a pool.

    Change-Id: Icf2aa2454f5f6beb928368fb06823576bbe57f2f
    Closes-Bug: #1231704

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: havana-rc1 → 2013.2
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.