KeyError: 'instance' raised when attaching a volume to an instance
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Medium
|
Tihomir Trifonov |
Bug Description
I have got the following error, when I was attaching a volume to an instance.
[Tue May 15 15:10:18 2012] [error]
[Tue May 15 15:10:18 2012] [error] CRITICAL:
[Tue May 15 15:10:18 2012] [error] Traceback (most recent call last):
[Tue May 15 15:10:18 2012] [error] File "/usr/local/
[Tue May 15 15:10:18 2012] [error] response = callback(request, *callback_args, **callback_kwargs)
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] return view_func(request, *args, **kwargs)
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] return view_func(request, *args, **kwargs)
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] return view_func(request, *args, **kwargs)
[Tue May 15 15:10:18 2012] [error] File "/usr/local/
[Tue May 15 15:10:18 2012] [error] return self.dispatch(
[Tue May 15 15:10:18 2012] [error] File "/usr/local/
[Tue May 15 15:10:18 2012] [error] return handler(request, *args, **kwargs)
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] handled = self.construct_
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
ables
[Tue May 15 15:10:18 2012] [error] preempted = table.maybe_
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
pt
[Tue May 15 15:10:18 2012] [error] error = exceptions.
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
pt
[Tue May 15 15:10:18 2012] [error] new_row.
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] data = column.
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] data = self.transform(
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
umes/tables.py", line 96, in get_attachment
[Tue May 15 15:10:18 2012] [error] "name": attachment[
[Tue May 15 15:10:18 2012] [error] KeyError: 'instance'
[Tue May 15 15:10:18 2012] [error] ERROR:django.
[Tue May 15 15:10:18 2012] [error] Traceback (most recent call last):
[Tue May 15 15:10:18 2012] [error] File "/usr/local/
[Tue May 15 15:10:18 2012] [error] response = callback(request, *callback_args, **callback_kwargs)
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] return view_func(request, *args, **kwargs)
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] return view_func(request, *args, **kwargs)
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] return view_func(request, *args, **kwargs)
[Tue May 15 15:10:18 2012] [error] File "/usr/local/
[Tue May 15 15:10:18 2012] [error] return self.dispatch(
[Tue May 15 15:10:18 2012] [error] File "/usr/local/
[Tue May 15 15:10:18 2012] [error] return handler(request, *args, **kwargs)
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] handled = self.construct_
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
ables
[Tue May 15 15:10:18 2012] [error] preempted = table.maybe_
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
pt
[Tue May 15 15:10:18 2012] [error] error = exceptions.
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
pt
[Tue May 15 15:10:18 2012] [error] new_row.
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] data = column.
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
[Tue May 15 15:10:18 2012] [error] data = self.transform(
[Tue May 15 15:10:18 2012] [error] File "/opt/stack/
umes/tables.py", line 96, in get_attachment
[Tue May 15 15:10:18 2012] [error] "name": attachment[
[Tue May 15 15:10:18 2012] [error] KeyError: 'instance'
2] [error] DEBUG:django.
ate" FROM "django_session" WHERE ("django_
-05-15 15:10:58.839426 ); args=('
[Tue May 15 15:10:58 2012] [error] DEBUG:horizon.
url "http://
[Tue May 15 15:10:58 2012] [error] DEBUG:glancecli
t: python-
[Tue May 15 15:10:58 2012] [error]
Finally the volume can be attached to this instance, but the error needs someone to take a look.
summary: |
- Errors raised when attaching a volume to an instance + KeyError: 'instance' raised when attaching a volume to an instance |
Changed in horizon: | |
importance: | Low → Medium |
Changed in horizon: | |
assignee: | nobody → Tihomir Trifonov (ttrifonov) |
Changed in horizon: | |
status: | Fix Committed → Fix Released |
Changed in horizon: | |
milestone: | folsom-2 → 2012.2 |
The relevant line is here: https:/ /github. com/openstack/ horizon/ blob/master/ horizon/ dashboards/ nova/instances_ and_volumes/ volumes/ tables. py#L96
If you're getting that error there's something strange about the data being returned by nova volume (e.g. it finds an attachment but that attachment doesn't have an "instance" key as it should), however we could code that more defensively and have it fail more elegantly.