DatabaseError: server closed the connection unexpectedly

asked 2013-08-15 09:50:51 -0500

Kirill gravatar image

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?

edit retag flag offensive close merge delete

Comments

What DB server you use?

Mustafa gravatar imageMustafa ( 2013-08-16 09:49:39 -0500 )edit

PostgreSQL 9.2

Kirill gravatar imageKirill ( 2013-08-19 06:05:10 -0500 )edit

have you check the DB server log? this issue its very general, and we have to more understand your deployment .. but i'm sure its not Askbot issue

Mustafa gravatar imageMustafa ( 2013-08-20 16:28:37 -0500 )edit