Returns 500 for unknown resources

Bug #1195925 reported by Evan Petrie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Feilong Wang
Grizzly
Fix Released
Medium
Eoghan Glynn

Bug Description

Making a request to GET /v2/resources/<resource_id> where resource_id does not match a valid resource ID returns a 500 error. The body of the response is:

{"error_message"=>"{\"debuginfo\": null, \"faultcode\": \"Server\", \"faultstring\": \"list index out of range\"}"}

This should probably return a 404.

Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Confirmed
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Feilong Wang (flwang) wrote :

I can recreate this issue. Will submit a fix for review.

Changed in ceilometer:
assignee: nobody → Fei Long Wang (flwang)
Feilong Wang (flwang)
Changed in ceilometer:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/35105
Committed: http://github.com/openstack/ceilometer/commit/fbb1eb9285c7787f8508d3f69790522ff6847fc8
Submitter: Jenkins
Branch: master

commit fbb1eb9285c7787f8508d3f69790522ff6847fc8
Author: Fei Long Wang <email address hidden>
Date: Mon Jul 1 16:12:03 2013 +0800

    Fix return error when resource can't be found

    By current implement, the HTTP request for /v2/resources/<resource_id>
    will return 500 if there is no coresponding resource or the resource id
    is invalid. And the response is as below:

    {"error_message": "{"debuginfo": null, "faultcode": "Server",
    "faultstring": "list index out of range"}"}

    After fixed, the response will be like this:

    {"error_message": "{"debuginfo": null, "faultcode": "Client",
    "faultstring": "Invalid input for field/attribute resource_id.
    Value: '9'. Unknown resource"}"}

    Fixes bug: 1195925

    Change-Id: I73c73fb3ba57bc6cbbf421f9ac5ec3cdb68ce784

Changed in ceilometer:
status: In Progress → Fix Committed
Revision history for this message
Evan Petrie (ejp) wrote :

Can we get a grizzly backport for this?

Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → havana-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/39477

Eoghan Glynn (eglynn)
tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (stable/grizzly)

Reviewed: https://review.openstack.org/39477
Committed: http://github.com/openstack/ceilometer/commit/c51bfc29752ef1d4080149f0ed8cce5f3cb22129
Submitter: Jenkins
Branch: stable/grizzly

commit c51bfc29752ef1d4080149f0ed8cce5f3cb22129
Author: Fei Long Wang <email address hidden>
Date: Mon Jul 1 16:12:03 2013 +0800

    Fix return error when resource can't be found

    By current implement, the HTTP request for /v2/resources/<resource_id>
    will return 500 if there is no coresponding resource or the resource id
    is invalid. And the response is as below:

    {"error_message": "{"debuginfo": null, "faultcode": "Server",
    "faultstring": "list index out of range"}"}

    After fixed, the response will be like this:

    {"error_message": "{"debuginfo": null, "faultcode": "Client",
    "faultstring": "Invalid input for field/attribute resource_id.
    Value: '9'. Unknown resource"}"}

    Fixes bug: 1195925

    Change-Id: I73c73fb3ba57bc6cbbf421f9ac5ec3cdb68ce784
    (cherry picked from commit fbb1eb9285c7787f8508d3f69790522ff6847fc8)

tags: added: in-stable-grizzly
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential in-stable-grizzly
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: havana-2 → 2013.2
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.