Error message misleading when unable to create new image due to glance file filtering

Bug #1296722 reported by Tzach Shefi on 2014-03-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Medium
Nikunj Aggarwal

Bug Description

Description of problem:
When filtering supported file types in Glance, uploading a none supported file gives a none informative/misleading error on Horizon -> Error: Unable to create new image.

Uploading same image in Glance CLI returns a better warning: Invalid disk format

[root@cougar12 ~(keystone_admin)]# glance image-create --name isoShouldFail1 --disk-format iso --container-format bare --file /dsl-4.4.10.iso
Request returned failure status.
400 Bad Request
Invalid disk format 'iso' for image.
    (HTTP 400)

Version-Release number of selected component (if applicable):
 RHEL 6.5
 python-django-openstack-auth-1.1.2-2.el6ost.noarch
 openstack-glance-2013.2.2-2.el6ost.noarch

How reproducible:
Every time

Steps to Reproduce:
1. Setup deployment
2. on /etc/glance/glance-api.conf, enable disk_formats and remove one of them (I removed iso), disk_formats=ami,ari,aki,vhd,vmdk,raw,qcow2,vdi
3. Restart glance-api service
4. From Horizon upload a new image from file, select a file of the format you deleted from list on step 2.
5. Get Horizon error

Actual results:
On Horizon none informative error message: Error: Unable to create new image.

Expected results:
I'd expect a better error like: Unable to create new image, none supported "iso" format. Seeing as this info is found on Horizon.log why isn't it returned on error message.

Description of problem:
When filtering supported file types in Glance, uploading a none supported file gives a none informative/misleading error on Horizon -> Error: Unable to create new image.

Uploading same image in Glance CLI returns a better warning: Invalid disk format

[root@cougar12 ~(keystone_admin)]# glance image-create --name isoShouldFail1 --disk-format iso --container-format bare --file /dsl-4.4.10.iso
Request returned failure status.
400 Bad Request
Invalid disk format 'iso' for image.
    (HTTP 400)

Version-Release number of selected component (if applicable):
RHEL 6.5
python-django-openstack-auth-1.1.2-2.el6ost.noarch
openstack-glance-2013.2.2-2.el6ost.noarch

How reproducible:
Every time

Steps to Reproduce:
1. Setup deployment
2. on /etc/glance/glance-api.conf, enable disk_formats and remove one of them (on test removed iso) disk_formats=ami,ari,aki,vhd,vmdk,raw,qcow2,vdi
3. Restart glance-api service
4. From Horizon upload a new image from file, select a file of the format you deleted from list on step 2.
5. Get Horizon none informative error.

Actual results:
On Horizon none informative error message: Error: Unable to create new image.

Expected results:
I'd expect a better error like, Unable to create new image, none supported "iso" format. Seeing as this info is found on Horizon.log(see below) why isn't this important info featured on Horizon's error message.

Horizon.log

date: Mon, 24 Mar 2014 13:00:56 GMT
content-length: 58
content-type: text/plain; charset=UTF-8
x-openstack-request-id: req-45e2c4b5-abb7-48a3-8725-132e34c06de0

400 Bad Request
Invalid disk format 'iso' for image.

2014-03-24 13:00:57,119 4603 ERROR glanceclient.common.http Request returned failure status.
2014-03-24 13:00:57,119 4603 WARNING horizon.exceptions Recoverable error: 400 Bad Request
Invalid disk format 'iso' for image.
    (HTTP 400)
2014-03-24 13:00:57,152 4603 DEBUG horizon.base Panel with slug "domains" is not registered with Dashboard "admin".
2014-03-24 13:00:57,152 4603 DEBUG horizon.base Panel with slug "groups" is not registered with Dashboard "admin".

Julie Pichon (jpichon) wrote :

There's a general blueprint for improving error messages in general, see https://blueprints.launchpad.net/horizon/+spec/improve-error-message-details-for-usability .

In this case I think the administrator should also update OPENSTACK_IMAGE_BACKEND in the local settings in order to keep the list accurate, see http://docs.openstack.org/developer/horizon/topics/settings.html#openstack-image-backend (we can't get the list directly from Glance so it needs to be updated manually).

tags: added: error-reporting
summary: - Horizon Error: Unable to create new image. When Glance file filtering
- enabled
+ Error message misleading when unable to create new image due to glance
+ file filtering
Changed in horizon:
assignee: nobody → Nikunj Aggarwal (nikunj2512)

Fix proposed to branch: master
Review: https://review.openstack.org/131059

Changed in horizon:
status: New → In Progress
Changed in horizon:
assignee: Nikunj Aggarwal (nikunj2512) → David Lyle (david-lyle)
assignee: David Lyle (david-lyle) → Nikunj Aggarwal (nikunj2512)
David Lyle (david-lyle) on 2014-11-18
Changed in horizon:
importance: Undecided → Medium
milestone: none → kilo-1
Thierry Carrez (ttx) on 2014-12-18
Changed in horizon:
milestone: kilo-1 → kilo-2

Reviewed: https://review.openstack.org/131059
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=2e3294ec30f3d6b07e1ce9b6e4f2138fc98a26ef
Submitter: Jenkins
Branch: master

commit 2e3294ec30f3d6b07e1ce9b6e4f2138fc98a26ef
Author: nikunj2512 <email address hidden>
Date: Mon Oct 27 14:42:20 2014 +0530

    Fixes Error message during image upload due to file filtering

    When filtering supported file types in Glance, uploading a none supported
    file gives a none informative/misleading error on Horizon -> Error:
    Unable to create new image.
    Uploading same image in Glance CLI returns a better warning: Invalid
    disk format.

    Change-Id: I3dced3a1056bd5bb4495881f246fcab39fbc1bff
    Closes-bug: #1296722

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2015-02-05
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2015-04-30
Changed in horizon:
milestone: kilo-2 → 2015.1.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers