Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

DatabaseError: server closed the connection unexpectedly

Hi everybody!

We are getting this error very often:

Traceback (most recent call last):

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/core/handlers/base.py", line 89, in get_response response = middleware_method(request)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/askbot/middleware/anon_user.py", line 50, in process_request if request.user.is_anonymous():

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner self._setup()

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/utils/functional.py", line 248, in _setup self._wrapped = self._setupfunc()

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/contrib/auth/middleware.py", line 16, in <lambda> request.user = SimpleLazyObject(lambda: get_user(request))

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/contrib/auth/middleware.py", line 8, in get_user request._cached_user = auth.get_user(request)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/contrib/auth/__init__.py", line 98, in get_user user_id = request.session[SESSION_KEY]

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/contrib/sessions/backends/base.py", line 39, in __getitem__ return self._session[key]

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/contrib/sessions/backends/base.py", line 165, in _get_session self._session_cache = self.load()

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/contrib/sessions/backends/db.py", line 19, in load expire_date__gt=timezone.now()

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/manager.py", line 131, in get return self.get_query_set().get(args, *kwargs)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/query.py", line 361, in get num = len(clone)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/query.py", line 85, in __len__ self._result_cache = list(self.iterator())

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/query.py", line 291, in iterator for row in compiler.results_iter():

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter for rows in self.execute_sql(MULTI):

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql cursor.execute(sql, params)

File "/rest/u/apps/askbot_face/ve/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute return self.cursor.execute(query, args)

DatabaseError: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

What can be the root cause of this issue?