[Openstack] In Icehouse on CentOS 7.1, openstack_auth.user.Token is not JSON serializable

David Talmage dtalmage at isi.edu
Thu May 21 18:35:02 UTC 2015


I'm having a problem making Icehouse horizon work on CentOS 7.1.  I think it's 
related to a bug in Django 1.6.  When I log in as user "admin", I'm greeted by 
a Python stack dump and the complaint that openstack_auth.user.Token is not 
JSON serializable.

How do I fix this and/or work around it?

/var/log/horizon/horizon.log confirms that I logged in.  Immediately after the 
confirmation there's "Internal Server Error: /dashboard/auth/login/" and a 
python stack dump, which I've appended below.

I'm aware of this bug in Django 1.6, which I have installed:

https://github.com/pennersr/django-allauth/issues/916




Here is the stack dump:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 
199, in get_response
    response = middleware_method(request, response)
  File "/usr/lib/python2.7/site-
packages/django/contrib/sessions/middleware.py", line 38, in process_response
    request.session.save()
  File "/usr/lib/python2.7/site-
packages/django/contrib/sessions/backends/db.py", line 57, in save
    session_data=self.encode(self._get_session(no_load=must_create)),
  File "/usr/lib/python2.7/site-
packages/django/contrib/sessions/backends/base.py", line 87, in encode
    serialized = self.serializer().dumps(session_dict)
  File "/usr/lib/python2.7/site-packages/django/core/signing.py", line 88, in 
dumps
    return json.dumps(obj, separators=(',', ':')).encode('latin-1')
  File "/usr/lib64/python2.7/json/__init__.py", line 250, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib64/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <openstack_auth.user.Token object at 0x7f09ba7cced0> is not JSON 
serializable





More information about the Openstack mailing list