Unicode multi-bytes character raise 500 error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Blazar |
Undecided
|
Asmita Singh | ||
| python-novaclient |
Low
|
Asmita Singh |
Bug Description
Description:-
==============
If you try to create a host passing hostname as unicode multi-bytes characters, it gives 500 error.
Curl command:-
==============
$ curl -g -i -X POST http://
Response:-
=======
HTTP/1.1 500 INTERNAL SERVER ERROR
Date: Fri, 26 Oct 2018 09:26:27 GMT
Server: Apache/2.4.18 (Ubuntu)
Content-Type: application/json
Content-Length: 100
Connection: close
{"error_name": "INTERNAL_
blazar-a.service logs
Logs:-
=======
Oct 26 18:27:42 open <email address hidden>[101356]: 2018-10-26 18:27:42.542 101360 ERROR blazar.api.v1.utils [-] Request aborted with status code 500 and message 'Internal Server Error'
Oct 26 18:27:42 open <email address hidden>[101356]: 2018-10-26 18:27:42.543 101360 ERROR blazar.api.v1.utils [-] Traceback (most recent call last):
Oct 26 18:27:42 open <email address hidden>[101356]: File "/opt/stack/
Oct 26 18:27:42 open <email address hidden>[101356]: return func(**kwargs)
Oct 26 18:27:42 open <email address hidden>[101356]: File "/opt/stack/
Oct 26 18:27:42 open <email address hidden>[101356]: return api_utils.
Oct 26 18:27:42 open <email address hidden>[101356]: File "/opt/stack/
Oct 26 18:27:42 open <email address hidden>[101356]: return getattr(
Oct 26 18:27:42 open <email address hidden>[101356]: File "/opt/stack/
Oct 26 18:27:42 open <email address hidden>[101356]: return func(self, *args, **kwargs)
Oct 26 18:27:42 open <email address hidden>[101356]: File "/opt/stack/
Oct 26 18:27:42 open <email address hidden>[101356]: return func(self, to_update)
Oct 26 18:27:42 open <email address hidden>[101356]: File "/opt/stack/
Oct 26 18:27:42 open <email address hidden>[101356]: return self.manager_
Oct 26 18:27:42 open <email address hidden>[101356]: File "/opt/stack/
Oct 26 18:27:42 open <email address hidden>[101356]: host_values=
Oct 26 18:27:42 open <email address hidden>[101356]: File "/opt/stack/
Oct 26 18:27:42 open <email address hidden>[101356]: return self._client.
Oct 26 18:27:42 open <email address hidden>[101356]: File "/usr/local/
Oct 26 18:27:42 open <email address hidden>[101356]: return self.prepare(
Oct 26 18:27:42 open <email address hidden>[101356]: File "/usr/local/
Oct 26 18:27:42 open <email address hidden>[101356]: retry=self.retry)
Oct 26 18:27:42 open <email address hidden>[101356]: File "/usr/local/
Oct 26 18:27:42 open <email address hidden>[101356]: retry=retry)
Oct 26 18:27:42 open <email address hidden>[101356]: File "/usr/local/
Oct 26 18:27:42 open <email address hidden>[101356]: call_monitor_
Oct 26 18:27:42 open <email address hidden>[101356]: File "/usr/local/
Oct 26 18:27:42 open <email address hidden>[101356]: raise result
Oct 26 18:27:42 open <email address hidden>[101356]: KeyError: u'u\'\\
Oct 26 18:27:42 open <email address hidden>[101356]:
Changed in blazar: | |
assignee: | nobody → Asmita Singh (asmita2018) |
status: | New → In Progress |
description: | updated |
Tushar Patil (tpatil) wrote : | #1 |
Takashi Natsume (natsume-takashi) wrote : | #2 |
Python 2.7? 3.5 or 3.6?
Changed in python-novaclient: | |
status: | New → Incomplete |
Tushar Patil (tpatil) wrote : | #3 |
python-novaclient: This issue is reproducible in python 2.7.
Takashi Natsume (natsume-takashi) wrote : | #4 |
Fix proposed to branch: master (python-novaclient)
https:/
Changed in python-novaclient: | |
assignee: | nobody → Asmita Singh (asmita2018) |
status: | Incomplete → In Progress |
Changed in python-novaclient: | |
importance: | Undecided → Low |
Reviewed: https:/
Committed: https:/
Submitter: Zuul
Branch: master
commit 4450e7ba3176cd2
Author: asmita singh <email address hidden>
Date: Wed Jan 2 06:59:56 2019 +0000
Handle unicode multi-byte characters
If you pass unicode multi-byte character to 'hypervisor-list'
and 'instance-
and --before options respectively, it returns keyerror.
This patch fixes these issues by encoding the host name and
date passed to the --matching and --before options
respectively.
Closes-Bug: #1804156
Change-Id: I9587af7e0fdd92
Changed in python-novaclient: | |
status: | In Progress → Fix Released |
This issue was fixed in the openstack/
Pierre Riteau (priteau) wrote : | #7 |
@Asmita: does this fully fix the bug or is some work required on Blazar as well?
Asmita Singh (asmita2018) wrote : | #8 |
This fully fixes the bug.
Asmita Singh (asmita2018) wrote : | #9 |
@Pierre: This fully fixes the bug.
In python-novaclient, if you try to list hypervisors passing --matching parameter with unicode data, then it gives KeyError.
Tested on : Ubuntu 16.04.2 LTS
Check traceback here : http:// paste.openstack .org/show/ 744355