Public bug reported: 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.err.DataError) (1406, u"Data too long for column 'name' at row 1") Steps to reproduce: On current glance master: commit a6fa8d9ce7b135ef9fa6d38aa7a8c1cffebf0baa Merge: a1c8966 97158c3 Author: Jenkins <jenk...@review.openstack.org> Date: Wed Sep 20 17:17:20 2017 +0000 Merge "Open Queens for data migrations" command: $ glance md-tag-update --name Ab22222222222222222222222222222222222 2222222222222222222222222222222222222222222222222222222222222222222 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-VirtualBox devstack@g-api.service[9103]: ERROR glance.api.v2.metadef_tags [None req-af8f8144-6724-46a5-9d57-5fc 37d40fb2d admin admin] (pymysql.err.DataError) (1406, u"Data too long 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_tags_id)s'] [parameters: {'metadef_tags_id': 4, 'name': u'Ab2222222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222', 'updated_at': datetime.datetime(2017, 9, 18, 10, 15, 22, 367087)}]: DBDataError: (pymysql.err.DataError) (1406, u"Data too long 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_tags_id)s'] [parameters: {'metadef_tags_id': 4, 'name': u'Ab22222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222', 'updated_at': datetime.datetime(2017, 9, 18, 10, 15, 22, 367087)}] Sep 18 15:45:22 dbopenstack-VirtualBox devstack@g-api.service[9103]: [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/namespaces/OS::Compute::vMware/tags/Ab2 => generated 228 bytes in 72 msecs (HTTP/1.1 500) 4 headers in 184 bytes (1 switches on core 0) ** Affects: glance Importance: Undecided Assignee: Dinesh Bhor (dinesh-bhor) Status: New ** Changed in: glance Assignee: (unassigned) => Dinesh Bhor (dinesh-bhor) -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to Glance. https://bugs.launchpad.net/bugs/1719252 Title: some md-* create and update API's returns 500 error if user passes name with more than 80 characters Status in Glance: New 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.err.DataError) (1406, u"Data too long for column 'name' at row 1") Steps to reproduce: On current glance master: commit a6fa8d9ce7b135ef9fa6d38aa7a8c1cffebf0baa Merge: a1c8966 97158c3 Author: Jenkins <jenk...@review.openstack.org> Date: Wed Sep 20 17:17:20 2017 +0000 Merge "Open Queens for data migrations" command: $ glance md-tag-update --name Ab22222222222222222222222222222222222 2222222222222222222222222222222222222222222222222222222222222222222 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-VirtualBox devstack@g-api.service[9103]: ERROR glance.api.v2.metadef_tags [None req-af8f8144-6724-46a5-9d57-5fc 37d40fb2d admin admin] (pymysql.err.DataError) (1406, u"Data too long 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_tags_id)s'] [parameters: {'metadef_tags_id': 4, 'name': u'Ab2222222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222', 'updated_at': datetime.datetime(2017, 9, 18, 10, 15, 22, 367087)}]: DBDataError: (pymysql.err.DataError) (1406, u"Data too long 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_tags_id)s'] [parameters: {'metadef_tags_id': 4, 'name': u'Ab22222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222', 'updated_at': datetime.datetime(2017, 9, 18, 10, 15, 22, 367087)}] Sep 18 15:45:22 dbopenstack-VirtualBox devstack@g-api.service[9103]: [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/namespaces/OS::Compute::vMware/tags/Ab2 => generated 228 bytes in 72 msecs (HTTP/1.1 500) 4 headers in 184 bytes (1 switches on core 0) To manage notifications about this bug go to: https://bugs.launchpad.net/glance/+bug/1719252/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp