Nova API returns unicode Location Header
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Medium
|
Sujitha | ||
Ubuntu |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
The Nova Compute API returns a series of headers as a result of create operation. The location header is being returned as a unicode value which is not compliant with the RFC for HTTP.
I haven't figured out yet whether this is a global thing or specific to something more localised.
While not a problem when running with nova-api services directly the problem manifests itself if a user was to front the API with something that requires rfc compliant headers to be returned, such as Apache.
Eg execute: nova image-create 69136d40-
Response:
ERROR: <attribute 'message' of 'exceptions.
Apache's error log shows:
[Fri Oct 04 14:08:42 2013] [error] [client 192.168.4.63] mod_wsgi (pid=20280): Exception occurred processing WSGI script '/etc/apache2/
[Fri Oct 04 14:08:42 2013] [error] [client 192.168.4.63] TypeError: expected byte string object for header value, value of type unicode found
The actual image-create ends up being successful, even though the client receives a HTTP 500 response.
Environment: Openstack Grizzly on Ubuntu with package level 2013.1.3
While this is the same result as https:/
description: | updated |
tags: | added: api |
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Christopher Yeoh (cyeoh-0) |
Changed in nova: | |
status: | In Progress → Triaged |
assignee: | Christopher Yeoh (cyeoh-0) → nobody |
Changed in nova: | |
assignee: | nobody → Christopher Yeoh (cyeoh-0) |
status: | Triaged → In Progress |
Changed in nova: | |
assignee: | nobody → Sujitha (sujitha-neti) |
Changed in nova: | |
status: | Confirmed → Invalid |
The following simple patch sorted the issue out for me:
root@api2:~# diff servers.py /usr/lib/ python2. 7/dist- packages/ nova/api/ openstack/ compute/ servers. py 'Location' ] = image_ref 'Location' ] = image_ref. encode( 'utf-8' )
1382c1382
< resp.headers[
---
> resp.headers[