some md-* create and update API's returns 500 error if user passes name with more than 80 characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Low
|
Dinesh Bhor |
Bug Description
Following apis are returning 500 error if user passes name with more
than 80 characters:
* md-tag-create
* md-tag-update
* md-object-create
* md-object-update
* md-property-create
* md-property-update
This happens because there is a discrepancy in db column length and
glance-api length check in schema validation. In database the 'name'
field for these API's is defined as of maximum 80 characters and in
schema it is defined as of maximum 255 characters. So if user passes
name with more than 80 characters and less than 255 characters
database fails to store that value and shouts with following error
which leads to 500 error to API user:
(pymysql.
row 1")
Steps to reproduce:
On current glance master:
commit a6fa8d9ce7b135e
Merge: a1c8966 97158c3
Author: Jenkins <email address hidden>
Date: Wed Sep 20 17:17:20 2017 +0000
Merge "Open Queens for data migrations"
command:
$ glance md-tag-update --name Ab2222222222222
222222222222222
2222222 OS::Compute::vMware Ab2
500 Internal Server Error: The server has either erred or is incapable
of performing the requested operation. (HTTP 500)
g-api logs:
Sep 18 15:45:22 dbopenstack-
ERROR glance.
37d40fb2d admin admin] (pymysql.
for column 'name' at row 1") [SQL: u'UPDATE metadef_tags SET updated_at
=%(updated_at)s, name=%(name)s WHERE metadef_tags.id = %(metadef_
[parameters: {'metadef_tags_id': 4, 'name': u'Ab22222222222
222222222222222
'updated_at': datetime.
DBDataError: (pymysql.
'name' at row 1") [SQL: u'UPDATE metadef_tags
SET updated_
%(metadef_
u'Ab2222222222
222222222222222
datetime.
Sep 18 15:45:22 dbopenstack-
[pid: 9108|app: 0|req: 23/46] 127.0.0.1 () {40 vars in 659 bytes}
[Mon Sep 18 15:45:22 2017]
PUT /v2/metadefs/
generated 228 bytes in 72 msecs (HTTP/1.1 500) 4 headers in 184 bytes
(1 switches on core 0)
Changed in glance: | |
assignee: | nobody → Dinesh Bhor (dinesh-bhor) |
Changed in glance: | |
importance: | Undecided → Low |
Fix proposed to branch: master /review. openstack. org/507433
Review: https:/