Cinder v2 create and update api returns 500

Bug #1454244 reported by Pranali Deore
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Low
Pranali Deore

Bug Description

If you pass name or description parameter with long string of more than 255 characters to volume create api and volume
update api, then it returns 500 error code.

Create Volume:
1. Create volume using horizon with name > 255 characters
Raises 500 internal server error.

2. Create volume using horizon with description > 255 characters
Raises 500 internal server error.

Update Volume:
1. Update volume name
1.1 Create volume using horizon
1.2 Update newly created volume using horizon with name > 255 characters
Raises 500 internal server error.

2. Update volume description
2.1 Create volume using horizon
2.2 Update newly created volume using horizon with description > 255 characters
Raises 500 internal server error.

Revision history for this message
John Griffith (john-griffith) wrote :

This comes up about once a year or so. We set a String limit for things like name, host, topic etc of 255 chars in the database. I'm guessing you'd like to see a better/different response than a bare 500 that explains this limit?

Changed in cinder:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Eric Harney (eharney) wrote :

This sounds like something we should be returning 400 Bad Request or similar for, rather than a 500.

Changed in cinder:
assignee: nobody → Pranali Deore (pranali-deore)
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/182994

Changed in cinder:
status: Triaged → In Progress
Changed in cinder:
assignee: Pranali Deore (pranali-deore) → Abhijeet Malawade (abhijeet-malawade)
Changed in cinder:
assignee: Abhijeet Malawade (abhijeet-malawade) → Pranali Deore (pranali-deore)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/182994
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=a1bb185a1f0311c36fd590d48531ded6ccccc5c6
Submitter: Jenkins
Branch: master

commit a1bb185a1f0311c36fd590d48531ded6ccccc5c6
Author: PranaliDeore <email address hidden>
Date: Mon May 11 04:00:01 2015 -0700

    Validate name and description string

    If you pass name or description parameters with more than 255
    characters to create and update apis of volume and snapshot
    and create api of backup, then it returns 500 error code.

    Added new method validate_name_and_description() in
    cinder.api.openstack.wsgi.Controllera to validate string limit and
    returned 400 if limit exceeds and also removing leading or trailing
    whitespaces and string containing only whitespaces.

    APIImpact
    1. For all above APIs 400 response will be returned.
    2. Earlier it was possible to pass only whitespaces or leading-trailing
       spaces to 'name' parameter.
       Now it will raise 400 error if only whitespaces are passed and will
       remove leading-trailing spaces if present in other cases.

    Closes-Bug: 1454244
    Change-Id: Iaf7159e816f69fd776a09828c3bc1d27fc9fdcdb

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

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

Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/kilo)

Change abandoned by Sean McGinnis (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/213615
Reason: This review is > 4 weeks without comment and currently blocked by a core reviewer with a -2. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and contacting the reviewer with the -2 on this review to ensure you address their concerns.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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