Can't Update Volume Status on dashboard if cinder volume stunk at reserved status

Bug #1770326 reported by GUO Larry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
GUO Larry

Bug Description

I am using Openstack Version Queens with CentOS7
 OpenStack Horizon version:
# rpm -qa | grep horizon
puppet-horizon-12.4.0-1.el7.noarch
python-django-horizon-13.0.0-1.el7.noarch

several of my volumes stunk at reserved status for some reason. I tried to click "Update Volume Status" button on GUI, but no window pop out. Instead, a ERROR message display on the up-right corner.

"Danger: An error occurred. Please try again later."

The horizon.log complains:

2018-05-10 05:47:34,253 16741 ERROR django.request Internal Server Error: /dashboard/admin/volumes/6d6f9816-3f15-4475-bfad-2727768d85e8/update_status
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/site-packages/horizon/decorators.py", line 52, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/horizon/decorators.py", line 52, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/horizon/decorators.py", line 113, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/horizon/decorators.py", line 84, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/generic/edit.py", line 174, in get
    return self.render_to_response(self.get_context_data())
  File "/usr/share/openstack-dashboard/openstack_dashboard/dashboards/admin/volumes/views.py", line 233, in get_context_data
    context = super(UpdateStatusView, self).get_context_data(**kwargs)
  File "/usr/lib/python2.7/site-packages/horizon/forms/views.py", line 141, in get_context_data
    context = super(ModalFormView, self).get_context_data(**kwargs)
  File "/usr/lib/python2.7/site-packages/horizon/forms/views.py", line 74, in get_context_data
    context = super(ModalFormMixin, self).get_context_data(**kwargs)
  File "/usr/lib/python2.7/site-packages/horizon/forms/views.py", line 55, in get_context_data
    context = super(ModalBackdropMixin, self).get_context_data(**kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/generic/edit.py", line 93, in get_context_data
    kwargs['form'] = self.get_form()
  File "/usr/lib/python2.7/site-packages/horizon/forms/views.py", line 176, in get_form
    return form_class(self.request, **self.get_form_kwargs())
  File "/usr/share/openstack-dashboard/openstack_dashboard/dashboards/admin/volumes/forms.py", line 225, in __init__
    kwargs['initial']['status'] = choices[current_status]
KeyError: u'reserved'

I can successfully reset-state with openstack CLI command.

cinder reset-state --state available <volume id>

Revision history for this message
GUO Larry (larrygu) wrote :

https://review.openstack.org/#/c/330285

Introduced new attach cinder workflow. Which reserved used.

But dashboard don't have this "reserved" state available

GUO Larry (larrygu)
Changed in horizon:
assignee: nobody → GUO Larry (larrygu)
status: New → In Progress
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/567504

Ivan Kolodyazhny (e0ne)
Changed in horizon:
milestone: none → rocky-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/567504
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=4776428cb69c57408745f75bd5c24228e8bdea44
Submitter: Zuul
Branch: master

commit 4776428cb69c57408745f75bd5c24228e8bdea44
Author: Larry GUO <guo1017138@163.com>
Date: Thu May 10 08:09:58 2018 +0000

    Add reserved status key word to horizon

    Horizon don't have related change which align with the
    change in https://review.openstack.org/#/c/330285.
    With this fix, horizon can work as expected

    Change-Id: I5940c662a0bec2beaf4863e07f7244311ba51212
    Closes-Bug: #1770326
    Signed-off-by: GUO Larry <guo1017138@163.com>

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/572257

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 14.0.0.0b2

This issue was fixed in the openstack/horizon 14.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/queens)

Reviewed: https://review.openstack.org/572257
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=b9f0afe73d5120b3467ba407ad2dc33033b5747e
Submitter: Zuul
Branch: stable/queens

commit b9f0afe73d5120b3467ba407ad2dc33033b5747e
Author: Larry GUO <guo1017138@163.com>
Date: Thu May 10 08:09:58 2018 +0000

    Add reserved status key word to horizon

    Horizon don't have related change which align with the
    change in https://review.openstack.org/#/c/330285.
    With this fix, horizon can work as expected

    Change-Id: I5940c662a0bec2beaf4863e07f7244311ba51212
    Closes-Bug: #1770326
    Signed-off-by: GUO Larry <guo1017138@163.com>
    (cherry picked from commit 4776428cb69c57408745f75bd5c24228e8bdea44)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 13.0.2

This issue was fixed in the openstack/horizon 13.0.2 release.

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.