Openstack API returns unicode Location Header

Bug #938114 reported by Jason Cannavale on 2012-02-21
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Jason Cannavale

Bug Description

The Openstack 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.

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. Example output below.

[Fri Feb 17 16:09:34 2012] [error] 2012-02-17 16:09:34,004 INFO nova.api.openstack.wsgi [req-3b2d850c-8d96-4afd-b0ba-d2f6ede6dee8 admin 1] https://x:8774/v1.1/1/servers returned with HTTP 202
[Fri Feb 17 16:09:34 2012] [error] [client] mod_wsgi (pid=10356): Exception occurred processing WSGI script '/var/lib/nova/nova-api.wsgi'.
[Fri Feb 17 16:09:34 2012] [error] [client] TypeError: expected byte string object for header value, value of type unicode found - - [17/Feb/2012:16:09:33 -0600] "POST /v1.1/1/servers HTTP/1.1" 500 2448 "-" "python-novaclient"

In the above the server will complete the build, but novaclient will return an n/a (HTTP 500).

Fix proposed to branch: master

Changed in nova:
assignee: nobody → Jason Cannavale (jcannava)
status: New → In Progress

Submitter: Jenkins
Branch: master

commit 9c1de0b4cd7b9b1c7db65798a5308ae76fad1780
Author: Jason Cannavale <email address hidden>
Date: Tue Feb 21 14:32:55 2012 -0600

    Makes HTTP Location Header return as utf-8 as opposed to Unicode.

    Fixes bug 938114

    Change-Id: Ie8a495a8743d2f261fc8f9600cfa1df28a2d5b1e

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-02-29
Changed in nova:
milestone: none → essex-4
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-4 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers