Glance Add Image API returns 400 response for disk full scenario

Bug #919255 reported by Unmesh Gurjar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Eoghan Glynn

Bug Description

The Glance Add image API returns a BadRequest(400) response when the image storage media is full. The API should return an Internal Server Error(500) response instead.

Jay Pipes (jaypipes)
Changed in glance:
status: New → Triaged
importance: Undecided → Medium
tags: added: filesystem
Revision history for this message
Jay Pipes (jaypipes) wrote :

Not sure I agree with the argument for a 500 Internal Server Error. I think that a 413 Request Entity Too Large would be more appropriate.

My rationale is that if you try to upload a 200G image to a server with 100G free space, and a 500 is returned, the user may get the impression the server is completely dead, which it is not...

Revision history for this message
Brian Waldon (bcwaldon) wrote :

Yeah, that makes more sense to me

Revision history for this message
Jay Pipes (jaypipes) wrote :

OK, then, this should be a pretty simple fix... 413 should be returned, not 400. That way the client can distinguish between a disk full error and a server broken error.

tags: added: low-hanging-fruit
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/3536

Changed in glance:
assignee: nobody → Pavan Kumar Sunkara (pksunkara)
status: Triaged → In Progress
Jay Pipes (jaypipes)
Changed in glance:
milestone: none → essex-4
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/3536
Committed: http://github.com/openstack/glance/commit/c77776a9c9e6883b34f11204044a60564b506183
Submitter: Jenkins
Branch: master

commit c77776a9c9e6883b34f11204044a60564b506183
Author: Pavan Kumar Sunkara <email address hidden>
Date: Sun Jan 29 11:38:56 2012 +0530

    Fix Bug #919255

    Glance Add Image API returns 400 response for disk full scenario

    Change-Id: Ia275cfd423bb823583998167516878ced370547b
    Signed-off-by: Pavan Kumar Sunkara <email address hidden>

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Re-opening bug as translation from IOError to StorageFull is too permissive, and leads to StorageFull being raised in scenarios unrelated to disk space starvation.

Changed in glance:
status: Fix Committed → In Progress
assignee: Pavan Kumar Sunkara (pksunkara) → Eoghan Glynn (eglynn)
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/4247

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

Reviewed: https://review.openstack.org/4247
Committed: http://github.com/openstack/glance/commit/1d2356c8642f61bfa05226110a18cafcef55c6f0
Submitter: Jenkins
Branch: master

commit 1d2356c8642f61bfa05226110a18cafcef55c6f0
Author: Eoghan Glynn <email address hidden>
Date: Thu Feb 16 18:26:38 2012 +0000

    Ensure StorageFull only raised on space starvation

    Additional fix for lp 919255

    Limit StorageFull to cases of genuine disk space starvation (ENOSPC or
    EFBIG), in order to avoid confusion with 413 "Request entity too large"
    status being returned from POST /images for issues unrelated to space.

    Change-Id: Ib5e68e5d988d0f541803ffb3f37ddf88ac24e9dc

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: essex-4 → 2012.1
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.