Cannot set body to unicode without a charset errors

Bug #739609 reported by Jay Pipes
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

Showing up on all builds now are dozens of errors in running unit tests:

======================================================================
FAIL: test_get_servers_with_limit (nova.tests.api.openstack.test_servers.ServersTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/buildd/nova-2011.2~bzr839/nova/tests/api/openstack/test_servers.py", line 222, in test_get_servers_with_limit
    self.assertEqual(res.status_int, 400)
AssertionError: 500 != 400
-------------------- >> begin captured logging << --------------------
2011-03-21 18:24:53,192 DEBUG routes.middleware [-] Initialized with method overriding = True, and path info altering = True from (pid=17620) __init__ /usr/lib/pymodules/python2.6/routes/middleware.py:43
2011-03-21 18:24:53,202 DEBUG routes.middleware [-] Matched GET /servers from (pid=17620) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:97
2011-03-21 18:24:53,202 DEBUG routes.middleware [-] Route path: 'servers', defaults: {'action': u'index', 'controller': <nova.api.openstack.servers.Controller object at 0xa5807ac>} from (pid=17620) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:99
2011-03-21 18:24:53,203 DEBUG routes.middleware [-] Match dict: {'req': <Request at 0xa6d0dac GET http://localhost/v1.0/servers?limit=3>} from (pid=17620) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:100
2011-03-21 18:24:53,223 DEBUG routes.middleware [-] Initialized with method overriding = True, and path info altering = True from (pid=17620) __init__ /usr/lib/pymodules/python2.6/routes/middleware.py:43
2011-03-21 18:24:53,233 DEBUG routes.middleware [-] Matched GET /servers from (pid=17620) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:97
2011-03-21 18:24:53,233 DEBUG routes.middleware [-] Route path: 'servers', defaults: {'action': u'index', 'controller': <nova.api.openstack.servers.Controller object at 0xa6b0a6c>} from (pid=17620) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:99
2011-03-21 18:24:53,233 DEBUG routes.middleware [-] Match dict: {'req': <Request at 0xa76b54c GET http://localhost/v1.0/servers?limit=aaa>} from (pid=17620) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:100
2011-03-21 18:24:53,242 ERROR nova.api.openstack [-] Caught error: You cannot set the body to a unicode value without a charset
(nova.api.openstack): TRACE: Traceback (most recent call last):
(nova.api.openstack): TRACE: File "/build/buildd/nova-2011.2~bzr839/nova/api/openstack/__init__.py", line 56, in __call__
(nova.api.openstack): TRACE: return req.get_response(self.application)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/request.py", line 918, in get_response
(nova.api.openstack): TRACE: application, catch_exc_info=False)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/request.py", line 886, in call_application
(nova.api.openstack): TRACE: app_iter = application(self.environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/routes/middleware.py", line 130, in __call__
(nova.api.openstack): TRACE: response = self.app(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/exc.py", line 248, in __call__
(nova.api.openstack): TRACE: return self.generate_response(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/exc.py", line 239, in generate_response
(nova.api.openstack): TRACE: content_type=content_type
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/response.py", line 94, in __init__
(nova.api.openstack): TRACE: "You cannot set the body to a unicode value without a charset")
(nova.api.openstack): TRACE: TypeError: You cannot set the body to a unicode value without a charset

Example URL: http://launchpadlibrarian.net/66914207/buildlog_ubuntu-lucid-i386.nova_2011.2~bzr839-0ubuntu0ppa1~lucid1_FAILEDTOBUILD.txt.gz

This is also showing up in Glance's build reports, so my guesses would be code that is similar to both projects (wsgi.py is almost identical...) or perhaps the version of webob?

Revision history for this message
Brian Lamar (blamar) wrote :

I can't duplicate this with WebOb 1.0.6 (latest dev version), is this still an issue or was it resolved?

Revision history for this message
Soren Hansen (soren) wrote :

I don't believe this problem exists in Nova anymore. Jay, are you still seeing this?

Thierry Carrez (ttx)
Changed in nova:
status: New → Incomplete
Revision history for this message
Jay Pipes (jaypipes) wrote :

If they don't show up in build reports anymore, the problem is fixed...

Thierry Carrez (ttx)
Changed in nova:
status: Incomplete → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.