yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #86199
[Bug 1930551] [NEW] Instance image assumes that volume's image metadata exists
Public bug reported:
When I access an instance through /project/instance/${(ID), the
dashboard always show an error notification with message: Failed to get
attached volume.
The instance is working fine and the volume can be verified through openstack cli.
A quick grep for the error message shows the below code path in which, the instance.image processing in the Try path makes an assumption that volume metadata always exists. This is not the case when the volume was created with "no source, empty source" as Volume Source.
Also there is no logging code in this code path, so although we see the
error in dashboard, we don't find any log message that can indicate the
issue.
class OverviewTab(tabs.Tab):
name = _("Overview")
slug = "overview"
template_name = ("project/instances/"
"_detail_overview.html")
def get_context_data(self, request):
instance = self.tab_group.kwargs['instance']
if instance.volumes and not instance.image:
try:
volume = api.cinder.volume_get(
self.request, volume_id=instance.volumes[0].volumeId)
instance.image = {
'id': volume.volume_image_metadata['image_id'],
'name': volume.volume_image_metadata['image_name']}
except Exception:
exceptions.handle(self.request,
_('Failed to get attached volume.'))
return {"instance": instance}
** Affects: horizon
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1930551
Title:
Instance image assumes that volume's image metadata exists
Status in OpenStack Dashboard (Horizon):
New
Bug description:
When I access an instance through /project/instance/${(ID), the
dashboard always show an error notification with message: Failed to
get attached volume.
The instance is working fine and the volume can be verified through openstack cli.
A quick grep for the error message shows the below code path in which, the instance.image processing in the Try path makes an assumption that volume metadata always exists. This is not the case when the volume was created with "no source, empty source" as Volume Source.
Also there is no logging code in this code path, so although we see
the error in dashboard, we don't find any log message that can
indicate the issue.
class OverviewTab(tabs.Tab):
name = _("Overview")
slug = "overview"
template_name = ("project/instances/"
"_detail_overview.html")
def get_context_data(self, request):
instance = self.tab_group.kwargs['instance']
if instance.volumes and not instance.image:
try:
volume = api.cinder.volume_get(
self.request, volume_id=instance.volumes[0].volumeId)
instance.image = {
'id': volume.volume_image_metadata['image_id'],
'name': volume.volume_image_metadata['image_name']}
except Exception:
exceptions.handle(self.request,
_('Failed to get attached volume.'))
return {"instance": instance}
To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1930551/+subscriptions
Follow ups