Horizon is unable to show instance list is image_id is not set

Bug #1834747 reported by Michel Nicol on 2019-06-29
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Vishal Manchanda
Ubuntu Cloud Archive

Bug Description

My setup contains several instance made from empty volume and installation from iso image. Thus, those instances does not have any source image. But some instances still have have image_metadata to tweak instances . As an example, those are the metadata from one of my boot volume :
 volume_image_metadata | {u'hw_qemu_guest_agent': u'yes', u'hw_vif_multiqueue_enabled': u'true', u'os_require_quiesce': u'yes'}
Before Stein, I was able to go to project/instance and list every instances from the project, as expected.
Since Stein Horizon release, this page crash without much details.
After further investigation, I foud that the culprit is that piece of code in /usr/horizon/openstack_dashboard/dashboards/project/instances/views.py from line 184

                        boot_volume = volume_dict[instance_volumes[0]['id']]
                        if (hasattr(boot_volume, "volume_image_metadata") and
                                boot_volume.volume_image_metadata['image_id'] in
                            instance.image = image_dict[

I replace this code by that one to take care of the case where there are image metadata but no image_id:

                        boot_volume = volume_dict[instance_volumes[0]['id']]
                        if (hasattr(boot_volume, "volume_image_metadata")):
                            if (hasattr(boot_volume.volume_image_metadata, "image_id")):
                                if (boot_volume.volume_image_metadata['image_id'] in image_dict):
                                    instance.image = image_dict[
That corrected this specific bug but I might not be the only one impacted by it...

Akihiro Motoki (amotoki) wrote :

Thanks for the detail information. The bug detail really helps us.

When 'volume_image_metadata' was introduced, 'image_id' was the only usage of 'volume_image_metadata' and I guess horizon depends on that behavior. However, it is no longer true and we need to fix it.

Changed in horizon:
assignee: nobody → Akihiro Motoki (amotoki)
importance: Undecided → High
status: New → Confirmed
Akihiro Motoki (amotoki) wrote :

The code affects only stein and master.

tags: added: stein-backport-potential

Fix proposed to branch: master
Review: https://review.opendev.org/668595

Changed in horizon:
status: Confirmed → In Progress

Hi, Could you add more steps to reproduce this bug?
Actually, I am testing this patch and don't know how to launch an instance from empty volume and installation from the iso image.

Changed in horizon:
assignee: Akihiro Motoki (amotoki) → Vishal Manchanda (vishalmanchanda)

Reviewed: https://review.opendev.org/668595
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=42f4ef334d89a492103fdea2df982e108d5713ea
Submitter: Zuul
Branch: master

commit 42f4ef334d89a492103fdea2df982e108d5713ea
Author: Akihiro Motoki <email address hidden>
Date: Tue Jul 2 14:05:19 2019 +0900

    Do not always assume image_id in volume_image_metadata

    volume_image_metadata can contain only fields other than image_id.
    We should not assume volume_image_metadata always contain image_id
    when volume_image_metadata exists.

    Change-Id: I0db8a05e488eb6bf276760d5116d05633c882701
    Closes-Bug: #1834747

Changed in horizon:
status: In Progress → Fix Released
Alvaro Uria (aluria) wrote :

Fix has been released on 15.0.1 but openstack-dashboard package is 15.0.0. See fix at https://review.opendev.org/#/c/657181/2/openstack_dashboard/dashboards/project/instances/views.py

Alvaro Uria (aluria) wrote :

Comment #6 was added at the same time the Ubuntu Cloud Archive project was added as affected by the bug. The Stein Cloud Archive would need a backport of this fix.

tags: added: canonical-bootstack
Alvaro Uria (aluria) wrote :

Per bug 1826690, this fix has actually been released in 15.1.0 (not 15.0.1).

James Page (james-page) wrote :

Cloud Archive being resolved under bug 1837905

Changed in cloud-archive:
status: New → Invalid

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

tags: added: field-medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers