Cinder type-create and type-update api returns 500

Bug #1450388 reported by Pranali Deore
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Pranali Deore

Bug Description

If you pass name parameter with long string of more than 255 characters, then cinder api returns 500 error.

$ cinder type-create ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggghhhhhhhhhhhhhhhh

ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-7c625e98-9744-4feb-856a-9085c1f70738)

$cinder type-update 3229e0e1-479c-4989-8f07-7554029a02c2 --name 67ygukkkkkkkkkkygggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg

ERROR: Cannot update volume_type 3229e0e1-479c-4989-8f07-7554029a02c2 (HTTP 500) (Request-ID: req-8be130a4-e345-488f-b06f-7d5f3f062b16)

Error log of cinder api:

DBError: (DataError) (1406, "Data too long for column 'name' at row 1") 'INSERT INTO volume_types (created_at, updated_at, deleted_at, deleted, id, name, description, qos_specs_id, is_public) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2015, 4, 30, 9, 25, 15, 379494), None, None, 0, '98aa8ea1-fee1-45c5-b3b0-024064714557', 'ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggghhhhhhhhhhhhhhhh', None, None, 1)
2015-04-30 02:25:15.381 TRACE cinder.volume.volume_types
2015-04-30 02:25:15.383 ERROR cinder.api.middleware.fault [req-7c625e98-9744-4feb-856a-9085c1f70738 a29cb2fa77ea44e4ab07cacbfa0365fd 11b77d031924417489bce1267e11002b] Caught error: Cannot create volume_type with name ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggghhhhhhhhhhhhhhhh and specs {}
2015-04-30 02:25:15.384 INFO cinder.api.middleware.fault [req-7c625e98-9744-4feb-856a-9085c1f70738 a29cb2fa77ea44e4ab07cacbfa0365fd 11b77d031924417489bce1267e11002b] http://10.69.4.136:8776/v2/11b77d031924417489bce1267e11002b/types returned with HTTP 500
2015-04-30 02:25:15.384 INFO eventlet.wsgi.server [req-7c625e98-9744-4feb-856a-9085c1f70738 a29cb2fa77ea44e4ab07cacbfa0365fd 11b77d031924417489bce1267e11002b] 10.69.4.136 - - [30/Apr/2015 02:25:15] "POST /v2/11b77d031924417489bce1267e11002b/types HTTP/1.1" 500 401 0.094978

Changed in cinder:
assignee: nobody → Pranali Deore (pranali-deore)
Revision history for this message
Erlon R. Cruz (sombrafam) wrote :

Have you tried to do the same thing using horizon? This does not look a bug to me. It looks like a defined limitation. If horizon allows you to input more than Cinder can handle then you have a bug, in horizon, but there's no way you can control that in the CLI.

Changed in cinder:
status: New → Invalid
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/183000

Changed in cinder:
status: Invalid → In Progress
Revision history for this message
Tushar Patil (tpatil) wrote :

Erlon: Not everyone is using Horizon to interact with cinder service. This issue also occurs when you try to call type-create api using curl command.

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

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

commit aeed2a788608b7b93bcdd70826ff0a3102c15027
Author: PranaliDeore <email address hidden>
Date: Wed Apr 29 02:35:52 2015 -0700

    Validate name and description for volume type

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

    Added a check in _create() and _update() methods of 'types_manage'
    extension to validate string limit and returned 400 if limit exceeds.

    Closes-Bug: 1450388
    Change-Id: I68c607df90a3dfeae7a841a1dddee5416fa42d13

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