Bug 1003984

Summary: horizon: cannot edit an image created with no params or missing params
Product: Red Hat OpenStack Reporter: Dafna Ron <dron>
Component: python-django-horizonAssignee: Julie Pichon <jpichon>
Status: CLOSED ERRATA QA Contact: Nir Magnezi <nmagnezi>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: aberezin, aortega, athomas, ddomingo, hateya, jpichon, mrunge, sradvan, yeylon
Target Milestone: rcKeywords: Triaged
Target Release: 4.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
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-20 00:23:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 976334    
Bug Blocks:    
Attachments:
Description Flags
log none

Description Dafna Ron 2013-09-03 16:12:51 UTC
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 18:18:16 UTC
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 13:30:20 UTC
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 09:54:30 UTC
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 15:48:13 UTC
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-20 00:23:21 UTC
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