Bug 1003984 - horizon: cannot edit an image created with no params or missing params
horizon: cannot edit an image created with no params or missing params
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-django-horizon (Show other bugs)
unspecified
x86_64 Linux
medium Severity medium
: rc
: 4.0
Assigned To: Julie Pichon
Nir Magnezi
storage
: Triaged
Depends On: 976334
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-03 12:12 EDT by Dafna Ron
Modified: 2015-02-15 17:02 EST (History)
9 users (show)

See Also:
Fixed In Version: python-django-horizon-2013.2-3.el6ost
Doc Type: Bug Fix
Doc Text:
Cause: There was an assumption on the Horizon pages showing details of an Image, that all the image properties would be set. Consequence: Many image properties in glance are optional and trying to display the image details for an image that for instance did not have a name would result in an error 500. Fix: Validate that a field exists before trying to display it. Result: The image details pages loads correctly even when there are missing attributes, and only displays the available properties.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-19 19:23:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
log (2.08 KB, application/x-gzip)
2013-09-03 12:12 EDT, Dafna Ron
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1220315 None None None Never
OpenStack gerrit 49043 None None None Never

  None (edit)
Description Dafna Ron 2013-09-03 12:12:51 EDT
Created attachment 793258 [details]
log

Description of problem:

I created an image through cli with missing params (glance image-create --name bla)
the image is stuck in queued state (different glance bug).
if I try to edit it through horizon we get an error:

[root@opens-vdsb lvm(keystone_admin)]# tail -f /var/log/httpd/access_log |grep 3e27c842-24d2-426d-9db4-74fa405a13eb

10.35.203.14 - - [03/Sep/2013:19:01:07 +0300] "GET /dashboard/admin/images/3e27c842-24d2-426d-9db4-74fa405a13eb/update/ HTTP/1.1" 500 809 "http://10.35.101.10/dashboard/admin/images/images/" "Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130619 Firefox/17.0"

but I am able to update the image from glance cli

Version-Release number of selected component (if applicable):

python-django-horizon-2013.1.3-2.el6ost.noarch

How reproducible:

100%

Steps to Reproduce:
1. create an image with missing params: glance image-create --name bla
2. go to horizon -> try to edit image
3. go to cli, modify the image: 
 glance image-update <Image ID> --disk-format qcow2 --container-format bare --location <location> 

Actual results:
we get an error in horizon but can update image in cli

Expected results:

we should be able to update the image

Additional info:


10.35.203.14 - - [03/Sep/2013:19:01:07 +0300] "GET /dashboard/admin/images/3e27c842-24d2-426d-9db4-74fa405a13eb/update/ HTTP/1.1" 500 809 "http://10.35.101.10/dashboard/admin/images/images/" "Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130619 Firefox/17.0"

Image bla:

[root@opens-vdsb lvm(keystone_admin)]# glance image-list
+--------------------------------------+-----------------------------+-------------+------------------+------------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+-----------------------------+-------------+------------------+------------+--------+
| dc79349e-de25-4ec5-8b12-5a6145270c47 | | qcow2 | bare | 1974140928 | active |
| 3e27c842-24d2-426d-9db4-74fa405a13eb | bla | | | | queued |
| 3ca51afa-531f-428a-9b9c-6dab33da85cd | dafna was here | | | | queued |
| 6981621e-673d-48a5-8c08-ca35eeac0c20 | dafna was here | | | | queued |
| 1264d201-f083-488f-b703-b2d428fefe21 | dafna*was@;ll-9bla-==+ here | | | | queued |
| 64593e6b-6edc-4d1f-ad64-0c2a0d8fe8f6 | dafna_was_here | | | | queued |
| 8c5fdb82-d85a-49df-8441-0c940aa62950 | dafna_was_here | | | | queued |
| 05c9b5e2-3082-4ad3-8d03-faf74b61234c | rhel64 | qcow2 | bare | 1974140928 | active |
| a32222e7-f879-41ab-b66b-5cad299b0b8d | test | qcow2 | bare | 31357907 | active |
| 9a611a39-b028-44dd-a8d0-027bbb3ce1eb | testttt | qcow2 | bare | 699592704 | active |
+--------------------------------------+-----------------------------+-------------+------------------+------------+--------+

update through glance:

[root@opens-vdsb lvm(keystone_admin)]# glance image-update 3e27c842-24d2-426d-9db4-74fa405a13eb --disk-format qcow2 --container-format bare --location http://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2013-09-03T16:00:13 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 3e27c842-24d2-426d-9db4-74fa405a13eb |
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | bla |
| owner | ad326a6c11a742c6bfdf4ad63be0c889 |
| protected | False |
| size | 1974140928 |
| status | active |
| updated_at | 2013-09-03T16:01:23 |
+------------------+--------------------------------------+
[root@opens-vdsb lvm(keystone_admin)]# glance image-list
+--------------------------------------+-----------------------------+-------------+------------------+------------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+-----------------------------+-------------+------------------+------------+--------+
| dc79349e-de25-4ec5-8b12-5a6145270c47 | | qcow2 | bare | 1974140928 | active |
| 3e27c842-24d2-426d-9db4-74fa405a13eb | bla | qcow2 | bare | 1974140928 | active |
| 3ca51afa-531f-428a-9b9c-6dab33da85cd | dafna was here | | | | queued |
| 6981621e-673d-48a5-8c08-ca35eeac0c20 | dafna was here | | | | queued |
| 1264d201-f083-488f-b703-b2d428fefe21 | dafna*was@;ll-9bla-==+ here | | | | queued |
| 64593e6b-6edc-4d1f-ad64-0c2a0d8fe8f6 | dafna_was_here | | | | queued |
| 8c5fdb82-d85a-49df-8441-0c940aa62950 | dafna_was_here | | | | queued |
| 05c9b5e2-3082-4ad3-8d03-faf74b61234c | rhel64 | qcow2 | bare | 1974140928 | active |
| a32222e7-f879-41ab-b66b-5cad299b0b8d | test | qcow2 | bare | 31357907 | active |
| 9a611a39-b028-44dd-a8d0-027bbb3ce1eb | testttt | qcow2 | bare | 699592704 | active |
+--------------------------------------+-----------------------------+-------------+------------------+------------+--------+
Comment 4 Julie Pichon 2013-11-14 13:18:16 EST
This was fixed in Havana RC1 upstream, confirmed this is resolved in python-django-horizon-2013.2-3.el6ost.
Comment 6 Nir Magnezi 2013-12-01 08:30:20 EST
Hey,

What is the new expected behavior here?
I easily reproduced the glance bug (using glance image-create --name bla), but when I browse to http://<HOST>/dashboard/project/images_and_snapshots/ I can't edit the image.
on the other hand, when I access that image from Admin tab:
http://<HOST>/dashboard/admin/images/images/

I See an 'Edit' button, with some limited number of fields to edit:

Name --> Editable
Description --> Editable
Kernel ID --> Grayed out, a question[1]
Ramdisk ID --> Grayed out, a question[1]
Architecture --> Grayed out, a question[1]
Format --> Grayed out
Public --> Editable
Protected --> Editable

When I tried to modify the name, or add a description, I got blocked with an error:

This field is required. (referring to the Format field, which is grayed out)


[1] Is this even suppose to be here? can remember I've  seen such a field before.
Comment 7 Julie Pichon 2013-12-02 04:54:30 EST
Before this was fixed, the dashboard would crash with an error 500 when navigating to the image details page. If you can see the image details it seems this was fixed successfully.

From the regular user screen: 
 - You should be able to edit images you own if their status is 'Active' (but I think creating an image with missing parameters means it never reaches that stage)

From the admin screen:
 - The kernel and ramdisk id fields remind me of EC2 fields, and seem to come from the glance image 'property' dictionary. I'm guessing it's there to offer useful information when using AWS-compatible images.
 - Not being able to edit the format even though it is a required field isn't an ideal user experience. I believe the UI aims to optimise for the most common case, in which the format should never change over the lifetime of an image and changing it would cause problems. If this is thought to be a bug, we should file it separately from this one (I can see the point of the view from either side.)

Thank you!
Comment 8 Nir Magnezi 2013-12-02 10:48:13 EST
Thanks for the detailed answer!

So based on Comment #6 and Comment #7:
Verified NVR: python-django-horizon-2013.2-5.el6ost.noarch
Comment 11 errata-xmlrpc 2013-12-19 19:23:21 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2013-1859.html

Note You need to log in before you can comment on or make changes to this bug.