log

log

Grigory Ozhegov

1511086135.196736 2017-11-19 13:08:55,196 [31538] [ctxLogger::view:handle_exception:124] ERROR: [ctx:e9d6731ae0] [user_id:None] Exception: (2006, 'MySQL server has gone away').

Traceback (most recent call last):

 File "/opt/otus/env/lib/python3.6/site-packages/django/contrib/sessions/backends/base.py", line 202, in _get_session

  return self._session_cache

AttributeError: 'SessionStore' object has no attribute '_session_cache'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 65, in execute

  return self.cursor.execute(sql, params)

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 101, in execute

  return self.cursor.execute(query, args)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/cursors.py", line 250, in execute

  self.errorhandler(self, exc, value)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler

  raise errorvalue

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/cursors.py", line 247, in execute

  res = self._query(query)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/cursors.py", line 411, in _query

  rowcount = self._do_query(q)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/cursors.py", line 374, in _do_query

  db.query(q)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/connections.py", line 292, in query

  _mysql.connection.query(self, query)

_mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away')


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

 File "/opt/otus/env/lib/python3.6/site-packages/aiokts/web/view.py", line 180, in __iter__

  yield from self.pre_handle()

 File "/opt/otus/src/async/web/views/base.py", line 23, in pre_handle

  self.ctx.data.user = get_user(self.ctx.data)

 File "/opt/otus/env/lib/python3.6/site-packages/django/contrib/auth/__init__.py", line 210, in get_user

  user_id = _get_user_session_key(request)

 File "/opt/otus/env/lib/python3.6/site-packages/django/contrib/auth/__init__.py", line 61, in _get_user_session_key

  return get_user_model()._meta.pk.to_python(request.session[SESSION_KEY])

 File "/opt/otus/env/lib/python3.6/site-packages/django/contrib/sessions/backends/base.py", line 57, in __getitem__

  return self._session[key]

 File "/opt/otus/env/lib/python3.6/site-packages/django/contrib/sessions/backends/base.py", line 207, in _get_session

  self._session_cache = self.load()

 File "/opt/otus/env/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py", line 35, in load

  expire_date__gt=timezone.now()

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method

  return getattr(self.get_queryset(), name)(*args, **kwargs)

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/models/query.py", line 374, in get

  num = len(clone)

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/models/query.py", line 232, in __len__

  self._fetch_all()

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/models/query.py", line 1118, in _fetch_all

  self._result_cache = list(self._iterable_class(self))

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/models/query.py", line 53, in __iter__

  results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 886, in execute_sql

  raise original_exception

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 876, in execute_sql

  cursor.execute(sql, params)

 File "/opt/otus/env/lib/python3.6/site-packages/raven/contrib/django/client.py", line 114, in execute

  return real_execute(self, sql, params)

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 65, in execute

  return self.cursor.execute(sql, params)

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/utils.py", line 94, in __exit__

  six.reraise(dj_exc_type, dj_exc_value, traceback)

 File "/opt/otus/env/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise

  raise value.with_traceback(tb)

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 65, in execute

  return self.cursor.execute(sql, params)

 File "/opt/otus/env/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 101, in execute

  return self.cursor.execute(query, args)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/cursors.py", line 250, in execute

  self.errorhandler(self, exc, value)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler

  raise errorvalue

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/cursors.py", line 247, in execute

  res = self._query(query)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/cursors.py", line 411, in _query

  rowcount = self._do_query(q)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/cursors.py", line 374, in _do_query

  db.query(q)

 File "/opt/otus/env/lib/python3.6/site-packages/MySQLdb/connections.py", line 292, in query

  _mysql.connection.query(self, query)

django.db.utils.OperationalError: (2006, 'MySQL server has gone away')