Member create raises 500 error for unicode charater values
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| Glance |
Fix Released
|
Undecided
|
Bhagyashri Shewale | ||
Bug Description
If user passes member as Unicode character while creating member for image then he will get HTTP 500 error.
Steps to reproduce:
1. Create image
2. Assign member to image using
$ glance member-create e64f4347-
or using curl
$ curl -g -i -X POST http://
Output:
<html>
<head>
<title>500 Internal Server Error</title>
</head>
<body>
<h1>500 Internal Server Error</h1>
The server has either erred or is incapable of performing the requested operation.<br /><br />
</body>
</html>
API Logs:
500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi self._flush(
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi transaction.
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi compat.
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi flush_context.
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi rec.execute(self)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi uow
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi mapper, table, insert)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi execute(statement, params)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi return meth(self, multiparams, params)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi return connection.
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi compiled_sql, distilled_params
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi context)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi util.raise_
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi reraise(
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi context)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi cursor.
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi result = self._query(query)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi conn.query(q)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi self._affected_rows = self._read_
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi result.read()
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi first_packet = self.connection
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi packet.
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi err.raise_
2017-05-04 12:18:14.460 TRACE glance.common.wsgi File "/usr/local/
2017-05-04 12:18:14.460 TRACE glance.common.wsgi raise errorclass(errno, errval)
2017-05-04 12:18:14.460 TRACE glance.common.wsgi DBDataError: (pymysql.
| Changed in glance: | |
| assignee: | nobody → Neha Pandey (nehapandey) |
| summary: |
- Member create raises 500 error for 4 byte unicode charater + Member create raises 500 error for unicode charater values |
| Changed in glance: | |
| assignee: | Neha Pandey (nehapandey) → Bhagyashri Shewale (bhagyashri-shewale) |

Reviewed: https:/ /review. openstack. org/500735 /git.openstack. org/cgit/ openstack/ glance/ commit/ ?id=05e9bdb656d 9c120ed3cd6ffc8 ae7dbf5614b5e4
Committed: https:/
Submitter: Zuul
Branch: master
commit 05e9bdb656d9c12 0ed3cd6ffc8ae7d bf5614b5e4
Author: neha.pandey <email address hidden>
Date: Thu May 4 16:53:08 2017 +0530
Fix member create to handle unicode characters
If user passes member id as unicode characters in member create then
HTTP 500 internal server error is raised.
Reason: The unicode format check is not performed in db create member.
This patch fixes the member create by checking member id before
inserting in db. If member id is unicode then proper exception
is raised and same is handled in controller api.
Change-Id: I67be5e990d1269 cbb986db7fff21a 90a41af06e4
Closes-Bug: #1688189