i18n - Terminating instance with invalid instance id causes error in the response
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Tushar Patil |
Bug Description
When Japanese Locale is used, nova cannot reply UTF-8 error message correctly. Because type-mismatch error between utf-8 and string occurs.
To reproduce this problem, please do following steps.
1.place attached Japanese (utf-8) .mo file to locale directory. path is: /usr/share/
2.execute nova-api daemon with language setting (LANGUAGE=
example:
LANGUAGE=
3.execute command. euca-terminate-
This command should return error response because instance does not exists.
nova-api got error.
root@usv401:
Warning: failed to parse error message from AWS: <unknown>:1:0: syntax error
BotoServerError: 500 Internal Server Error
Traceback (most recent call last):
File "/usr/lib/
result = self.applicatio
File "/usr/lib/
return resp(environ, start_response)
File "/usr/lib/
response = self.app(environ, start_response)
File "/usr/lib/
return resp(environ, start_response)
File "/usr/lib/
return resp(environ, start_response)
File "/usr/lib/
return resp(environ, start_response)
File "/usr/lib/
return resp(environ, start_response)
File "/usr/lib/
return resp(environ, start_response)
File "/usr/lib/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/
return self.func(req, *args, **kwargs)
File "/opt/openstack
return self._error(req, type(ex).__name__, str(ex))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128)
I still feel that this patch is not sufficient. There could be couple of more similar issues at other places. For e.g. if the data associated with any of the entity like instance/image contains UTF-8(Multi-byte) data then I think that it will crash while sending the response.
Related branches
- Vish Ishaya (community): Approve
- Devin Carlen (community): Approve
- Jay Pipes: Pending requested
-
Diff: 46 lines (+10/-8)1 file modifiednova/api/ec2/__init__.py (+10/-8)
Changed in nova: | |
importance: | Undecided → Medium |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → 2011.1 |
status: | Fix Committed → Fix Released |
Patch looks good with exception of leaving a statement commented out. I'll get a fix for this proposed shortly. Thanks, Tushar!