﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
14093	Confusing error when failing to create a session key because the cache is unavailable	szymon@…	Aymeric Augustin	"Hi,

We are using Django 1.2.1, cache session backend and from time to time, on higher traffic (but not so much, ~600 online users in 5 minutes) a few requests ends with exception:

Traceback (most recent call last):

 File ""/usr/lib64/python2.6/site-packages/django/core/handlers/base.py"", line 80, in get_response
   response = middleware_method(request)

 File ""/home/wonderlife/app/request.py"", line 78, in process_request
   if request.user.is_authenticated():

 File ""/usr/lib64/python2.6/site-packages/django/contrib/auth/middleware.py"", line 9, in __get__
   request._cached_user = get_user(request)

 File ""/usr/lib64/python2.6/site-packages/django/contrib/auth/__init__.py"", line 97, in get_user
   user_id = request.session[SESSION_KEY]

 File ""/usr/lib64/python2.6/site-packages/django/contrib/sessions/backends/base.py"", line 46, in __getitem__
   return self._session[key]

 File ""/usr/lib64/python2.6/site-packages/django/contrib/sessions/backends/base.py"", line 172, in _get_session
   self._session_cache = self.load()

 File ""/usr/lib64/python2.6/site-packages/django/contrib/sessions/backends/cache.py"", line 16, in load
   self.create()

 File ""/usr/lib64/python2.6/site-packages/django/contrib/sessions/backends/cache.py"", line 33, in create
   raise RuntimeError(""Unable to create a new session key."")

RuntimeError: Unable to create a new session key."	Bug	closed	contrib.sessions	1.2	Normal	fixed	session, cache, session key	Alan Justino da Silva	Accepted	1	0	0	0	1	0
