Updating image with invalid operation type raises 500

Bug #1456157 reported by Kamil Rykowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Kamil Rykowski
Kilo
Fix Released
High
Kamil Rykowski

Bug Description

When trying to update an image using PATCH method I got Internal Server Error when 'op' (operation) has invalid value. We could consider changing this behavior to return some kind of 40x message (400 probably).

Steps to reproduce:
URL: http://localhost:9292/v2/images/<image_id>
Headers:
  X-Auth-Token: XYZ
  Content-Type: application/openstack-images-v2.1-json-patch
Data:
[{"path": "/description", "value": "", "op": "axdd"}]

Result: 500 Internal Server Error

I'm opening it as `Opinion`, as there can be a reason why are we returning 500 instead of some 40x code.

Changed in glance:
status: New → Opinion
assignee: nobody → Kamil Rykowski (kamil-rykowski)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
status: Opinion → In Progress
Erno Kuvaja (jokke)
Changed in glance:
importance: Undecided → High
tags: added: kilo-backport-potential
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/190995

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

Reviewed: https://review.openstack.org/190995
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=abc2a0c1f4be926f742eff57b3d8643d578f8861
Submitter: Jenkins
Branch: stable/kilo

commit abc2a0c1f4be926f742eff57b3d8643d578f8861
Author: Kamil Rykowski <email address hidden>
Date: Mon May 18 13:19:54 2015 +0200

    Change status code from 500 to 400 for image update request

    Invalid 'op' (operation) value provided for image update PATCH request
    results in raising Internal Server Error (500). There is no helpful
    information what went wrong and how to fix this particular request.
    Proposed fix change the status code from 500 to 400 and return proper
    message, so the user won't be confused and will be able to adjust the
    request.

    Change-Id: Ie20a3f350cbaa46c558b4e49b46091d1e4a74807
    Closes-Bug: 1456157
    (cherry picked from commit 9f9629ada550c7ddf66fd03d6604e16a5712881f)

Changed in glance:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: liberty-1 → 11.0.0
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.