djangopython-3.xdjango-wsgi

Django Suspicious Operation Request Session deleted


I try to get my django page running on my server and stumble upon the following error message in my browser:

SuspiciousOperation at /lfp/filter/

The request's session was deleted before the request completed. The user may have logged out in a concurrent request, for example.

The traceback you can find here:

Environment:


Request Method: GET
Request URL: http://localhost/pass/lfp/filter/

Django Version: 1.11.2
Python Version: 3.6.1
Installed Applications:
['django_tables2',
 'pass_list.apps.PassListConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)

File "/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py" in execute
  328.         return Database.Cursor.execute(self, query, params)

The above exception (attempt to write a readonly database) was the direct cause of the following exception:

File "/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in save
  87.                 obj.save(force_insert=must_create, force_update=not must_create, using=using)

File "/lib/python3.6/site-packages/django/db/models/base.py" in save
  806.                        force_update=force_update, update_fields=update_fields)

File "/lib/python3.6/site-packages/django/db/models/base.py" in save_base
  836.             updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)

File "/lib/python3.6/site-packages/django/db/models/base.py" in _save_table
  903.                                       forced_update)

File "/lib/python3.6/site-packages/django/db/models/base.py" in _do_update
  953.         return filtered._update(values) > 0

File "/lib/python3.6/site-packages/django/db/models/query.py" in _update
  664.         return query.get_compiler(self.db).execute_sql(CURSOR)

File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
  1191.         cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)

File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
  886.             raise original_exception

File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
  876.             cursor.execute(sql, params)

File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
  80.             return super(CursorDebugWrapper, self).execute(sql, params)

File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)

File "/lib/python3.6/site-packages/django/db/utils.py" in __exit__
  94.                 six.reraise(dj_exc_type, dj_exc_value, traceback)

File "/lib/python3.6/site-packages/django/utils/six.py" in reraise
  685.             raise value.with_traceback(tb)

File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)

File "/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py" in execute
  328.         return Database.Cursor.execute(self, query, params)

During handling of the above exception (attempt to write a readonly database), another exception occurred:

File "/lib/python3.6/site-packages/django/contrib/sessions/middleware.py" in process_response
  58.                             request.session.save()

File "/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in save
  94.                 raise UpdateError

During handling of the above exception (), another exception occurred:

File "/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/lib/python3.6/site-packages/django/utils/deprecation.py" in __call__
  142.             response = self.process_response(request, response)

File "/lib/python3.6/site-packages/django/contrib/sessions/middleware.py" in process_response
  61.                                 "The request's session was deleted before the "

Exception Type: SuspiciousOperation at /lfp/filter/
Exception Value: The request's session was deleted before the request completed. The user may have logged out in a concurrent request, for example.

How can I solve that issue?


Solution

  • I solved my problem. It was a problem with the access management. The file db.sqlite3 was just readable. Changing the rights solved my problem.