Create volume API does not validate metadata

Bug #1096018 reported by Unmesh Gurjar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
John Griffith

Bug Description

Branch: master

Steps to repro:
1. Create a volume using the following POST body (containing a key which exceeds the database limit of 255 chars):
{
    "volume": {
        "display_name": "vol-001",
        "display_description": "Another volume.",
        "size": 1,
        "metadata": {"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss": "value1"}
     }
}
2. Observe the API response.

Expected Behavior:
API should return a 413 RequestEntityTooLarge.

Actual Result:
API returns a 200 Ok, however, truncates the (large) metadata.

NOTE: similar behavior on defining metadata containing 0 sized key/value.

Tags: ntt
Changed in cinder:
assignee: nobody → Unmesh Gurjar (unmesh-gurjar)
description: updated
Mike Perez (thingee)
Changed in cinder:
status: New → Triaged
Revision history for this message
John Griffith (john-griffith) wrote :

This is currently in progress as part of bp update-vol-metadata.

Changed in cinder:
assignee: Unmesh Gurjar (unmesh-gurjar) → John Griffith (john-griffith)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/19790
Committed: http://github.com/openstack/cinder/commit/bd71987bbf67715c8b84519b3ba3ac80552a901e
Submitter: Jenkins
Branch: master

commit bd71987bbf67715c8b84519b3ba3ac80552a901e
Author: john-griffith <email address hidden>
Date: Tue Jan 15 23:38:11 2013 -0700

    Add capability to update volume metadata.

    This addresses some cleanup and bugs with volume metadata updates
    on the cinder side. Mostly this implements v1/volume_metadata api
    and adds things like propery checks to cinder.volume.api.update_volume_meta.

    NOTE: This is only for api V1, a seperate patch will be provided for
    V2 once this lands.

    The remainder of the bp will be implemented in a cinderclient patch to follow.
    Implement cinder side of blueprint update-vol-metadata

    Also fixes bug: 1096018

    Change-Id: Ie11931f657d3dcd69680fe5fcae435ff89549d97

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: grizzly-3 → 2013.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.