Location add does not catch BadStoreUri

Bug #1502850 reported by Niall Bunting
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Niall Bunting
Kilo
In Progress
Medium
Niall Bunting
Liberty
Fix Released
Medium
Niall Bunting

Bug Description

Overview:
If you create an image and then use location-add to add a bad uri, the server returns a 500. As the BadStoreUri is not caught.

How to produce:
glance image-create

glance location-add de6d8022-6954-4039-b53a-042e2fc909de --url file://
500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)

2015-10-05 10:31:54.015 TRACE glance.common.wsgi raise exceptions.BadStoreUri(uri=uri)
2015-10-05 10:31:54.015 TRACE glance.common.wsgi BadStoreUri: The Store URI was malformed: http://

Output:
500

Expected:
400

Changed in glance:
assignee: nobody → Niall Bunting (niall-bunting)
Changed in glance:
status: New → In Progress
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :
Revision history for this message
Niall Bunting (niall-bunting) wrote :
Revision history for this message
Mike Fedosin (mfedosin) wrote :

I thought it was fixed in 200000. And by the way, I can't reproduce this bug on the latest devstack:

mfedosin@wdev:/opt/stack/nova$ glance --os-image-api-version 2 location-add 885d1cb0-9f5c-4677-9d03-175be7f9f984 --url file://gggg
400 Bad Request: Invalid location (HTTP 400)

Revision history for this message
Mike Fedosin (mfedosin) wrote :

Ah... without anything it works:
mfedosin@wdev:/opt/stack/nova$ glance --os-image-api-version 2 location-add ff76656b-c38c-4334-a0a2-27a97ab06111 --url file://
500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)

Changed in glance:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/230991
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=ad8af56036c7a253813585003b3ff9ea3745fc4d
Submitter: Jenkins
Branch: master

commit ad8af56036c7a253813585003b3ff9ea3745fc4d
Author: NiallBunting <email address hidden>
Date: Mon Oct 5 13:24:37 2015 +0000

    Location add catch bad Uri

    If a location is added with the Uri 'file://' or something similar it
    would cause the sever to raise a internal error. This now catches that
    exception, so the server can raise a 400 error.

    Closes-Bug: 1502850
    Change-Id: I10e4a65dea4a951e00c8ed92d0c3cdd74a786ace

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/254706

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/254712

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (stable/liberty)

Reviewed: https://review.openstack.org/254712
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=e3b0dbe2636dd6dc654e335fc01a2385aa947e81
Submitter: Jenkins
Branch: stable/liberty

commit e3b0dbe2636dd6dc654e335fc01a2385aa947e81
Author: NiallBunting <email address hidden>
Date: Mon Oct 5 13:24:37 2015 +0000

    Location add catch bad Uri

    If a location is added with the Uri 'file://' or something similar it
    would cause the sever to raise a internal error. This now catches that
    exception, so the server can raise a 400 error.

    Closes-Bug: 1502850
    Change-Id: I10e4a65dea4a951e00c8ed92d0c3cdd74a786ace
    (cherry picked from commit ad8af56036c7a253813585003b3ff9ea3745fc4d)

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/glance 12.0.0.0b2

This issue was fixed in the openstack/glance 12.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (stable/kilo)

Change abandoned by Niall Bunting (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/254706
Reason: Kilo is now only accepting security backport patches.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 11.0.2

This issue was fixed in the openstack/glance 11.0.2 release.

Changed in glance:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.