attach volume while status is 'creating'

Bug #712982 reported by TomDV
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Anthony Young
OpenStack Dashboard (Horizon)
Fix Released
High
Devin Carlen

Bug Description

Attaching a volume that has status 'creating' throws an exception that isn't handled yet.
It's reproducible in the current bazaar branch.

NovaServerError at /project/myproject/volumes/attach
Bad Request
Request Method: POST
Request URL: http://10.0.2.116:8000/project/myproject/volumes/attach
Django Version: 1.2.3
Exception Type: NovaServerError
Exception Value:
Bad Request
Exception Location: /root/src/django-nova/trunk/src/django_nova/exceptions.py in decorator, line 80
Python Executable: /root/src/openstack-dashboard/trunk/.dashboard-venv/bin/python
Python Version: 2.6.6
Python Path: ['/root/src/openstack-dashboard/trunk/dashboard', '/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg', '/root/src/django-nova/trunk/src', '/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/site-packages/mox-0.5.3-py2.6.egg', '/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6', '/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/plat-linux2', '/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/lib-tk', '/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/lib-old', '/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/lib-dynload', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib64/python2.6/lib-tk', '/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/site-packages', '/root/src/openstack-dashboard/trunk', '/root/src/openstack-dashboard/trunk/dashboard', '/root/src/openstack-dashboard/trunk/dashboard']
Server time: Fri, 4 Feb 2011 02:22:19 -0800

Environment:

Request Method: POST
Request URL: http://10.0.2.116:8000/project/myproject/volumes/attach
Django Version: 1.2.3
Python Version: 2.6.6
Installed Applications:
['dashboard',
 'django.contrib.auth',
 'django.contrib.admin',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.comments',
 'django.contrib.sites',
 'django.contrib.markup',
 'django.contrib.syndication',
 'django_nose',
 'django_nova',
 'registration']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')

Traceback:
File "/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
  100. response = callback(request, *callback_args, **callback_kwargs)
File "/root/src/openstack-dashboard/trunk/.dashboard-venv/lib/python2.6/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  25. return view_func(request, *args, **kwargs)
File "/root/src/django-nova/trunk/src/django_nova/exceptions.py" in decorator
  90. return func(*args, **kwargs)
File "/root/src/django-nova/trunk/src/django_nova/views/volumes.py" in attach
  112. form.cleaned_data['device']
File "/root/src/django-nova/trunk/src/django_nova/exceptions.py" in decorator
  80. raise NovaServerError(e)

Exception Type: NovaServerError at /project/myproject/volumes/attach
Exception Value: Bad Request

Related branches

Devin Carlen (devcamcar)
Changed in openstack-dashboard:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Devin Carlen (devcamcar)
Revision history for this message
Devin Carlen (devcamcar) wrote :

Related to https://bugs.launchpad.net/nova/+bug/716847, though a bit different. In this case the volume is showing as "available" too soon within nova.

Changed in nova:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Devin Carlen (devcamcar) wrote :

Tony, is this issue fixed as well with https://bugs.launchpad.net/openstack-dashboard/+bug/712979?

Changed in nova:
assignee: nobody → sleepsonthefloor (sleepsonthefloor)
Revision history for this message
Anthony Young (sleepsonthefloor) wrote :

This error is slightly different from the original code for handling the deletion of volumes stuck in the 'creating' state (the fix for that was to provide a nova-manage command to deal with that situation)

Here, the api is responding with an error code that is not recognized by dashboard. I've added a fix, which allows this and other similar exceptions to be handled gracefully.

Thierry Carrez (ttx)
Changed in nova:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
Devin Carlen (devcamcar)
Changed in openstack-dashboard:
status: Confirmed → Fix Released
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.