← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1493440] [NEW] Login error if database is set for session backend

 

Public bug reported:

Steps to reproduce

1) login to horizon
perform some actions, make token expire

2) login again

--------------------------
setting has the following

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': '/home/fervent/murano-db.sqlite',
    }
}

SESSION_ENGINE = 'django.contrib.sessions.backends.db'
---------------------------------------------------------------------------------

Actual result

A server error occurred.  Please contact the administrator.

Login successful for user "kate".
Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
    return self.application(environ, start_response)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 189, in __call__
    response = self.get_response(request)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 218, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/openstack_auth/views.py", line 112, in login
    **kwargs)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/contrib/auth/views.py", line 51, in login
    auth_login(request, form.get_user())
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 102, in login
    if _get_user_session_key(request) != user.pk or (
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 59, in _get_user_session_key
    return get_user_model()._meta.pk.to_python(request.session[SESSION_KEY])
  File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 969, in to_python
    params={'value': value},
ValidationError: [u"'4b938e23c97940b18882d0fed87d809d' value must be an integer."]

Database is attached
Workaround: clear browser cookies

** Affects: horizon
     Importance: Undecided
         Status: New


** Tags: sessions

** Tags added: sessions

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1493440

Title:
  Login error if database is set for session backend

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  Steps to reproduce

  1) login to horizon
  perform some actions, make token expire

  2) login again

  --------------------------
  setting has the following

  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': '/home/fervent/murano-db.sqlite',
      }
  }

  SESSION_ENGINE = 'django.contrib.sessions.backends.db'
  ---------------------------------------------------------------------------------

  Actual result

  A server error occurred.  Please contact the administrator.

  Login successful for user "kate".
  Traceback (most recent call last):
    File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
      self.result = application(self.environ, self.start_response)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
      return self.application(environ, start_response)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 189, in __call__
      response = self.get_response(request)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 218, in get_response
      response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
      response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
      return view(request, *args, **kwargs)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
      response = view_func(request, *args, **kwargs)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
      response = view_func(request, *args, **kwargs)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/openstack_auth/views.py", line 112, in login
      **kwargs)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
      return view(request, *args, **kwargs)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
      response = view_func(request, *args, **kwargs)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
      response = view_func(request, *args, **kwargs)
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/contrib/auth/views.py", line 51, in login
      auth_login(request, form.get_user())
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 102, in login
      if _get_user_session_key(request) != user.pk or (
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 59, in _get_user_session_key
      return get_user_model()._meta.pk.to_python(request.session[SESSION_KEY])
    File "/home/fervent/Projects/horizon/.tox/venv/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 969, in to_python
      params={'value': value},
  ValidationError: [u"'4b938e23c97940b18882d0fed87d809d' value must be an integer."]

  Database is attached
  Workaround: clear browser cookies

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1493440/+subscriptions