Bug 1218894

Summary: Horizon: Re login failed after timeout
Product: [Community] RDO Reporter: Ido Ovadia <iovadia>
Component: python-django-openstack-authAssignee: Matthias Runge <mrunge>
Status: CLOSED CURRENTRELEASE QA Contact: Ido Ovadia <iovadia>
Severity: high Docs Contact:
Priority: urgent    
Version: KiloCC: apevec, bnemec, chris.brown, jliberma, john.allen, Kevin.Fox, kupo, madko, martin.millnert, mrunge, nbarcet, salmank, sspreitz, yeylon
Target Milestone: ---Keywords: Reopened
Target Release: Kilo   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-django-openstack-auth-1.2.0-2 python-django-horizon-2015.1.0-6.el7 python-django-openstack-auth-1.2.0-6.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1221117 (view as bug list) Environment:
Last Closed: 2016-05-09 15:10:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1218896    

Description Ido Ovadia 2015-05-06 07:12:26 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Matthias Runge 2015-05-06 07:15:01 UTC
ValidationError: [u"'7473c59b3d584ec2ba305fd3b98f0724' value must be an integer."]
INFO openstack_auth.forms Login successful for user "admin".
ERROR django.request Internal Server Error: /dashboard/auth/login/

Comment 2 Matthias Runge 2015-05-06 07:34:42 UTC
*** Bug 1218907 has been marked as a duplicate of this bug. ***

Comment 3 Matthias Runge 2015-05-06 07:35:13 UTC
ValidationError: [u"'7473c59b3d584ec2ba305fd3b98f0724' value must be an integer."]
2015-05-06 06:54:18,098 10010 INFO openstack_auth.forms Login successful for user "admin".
2015-05-06 06:54:18,099 10010 ERROR django.request Internal Server Error: /dashboard/auth/login/
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openstack_auth/views.py", line 111, in login
    **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/contrib/auth/views.py", line 51, in login
    auth_login(request, form.get_user())
  File "/usr/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 102, in login
    if _get_user_session_key(request) != user.pk or (
  File "/usr/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 "/usr/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 969, in to_python
    params={'value': value},

Comment 4 Matthias Runge 2015-05-06 07:37:05 UTC
workaround: clear cookies for horizon machine.

Comment 5 Ido Ovadia 2015-05-06 07:46:33 UTC
Steps to Reproduce:
===================
1. Install openstack RDO (Kilo)
2. Use Horizon
3. Wait for timeout

Actual results:
================
Login fail

Comment 6 Alan Pevec (Fedora) 2015-05-08 18:46:42 UTC
in kilo testing repo

Comment 7 Salman Khan 2015-05-21 10:02:56 UTC
I still see this issue. I have to clear the cache whenever session timeout to login again. 

[root@ctr-rdo-kilo ]# rpm -q python-django-openstack-auth
python-django-openstack-auth-1.2.0-2.el7.noarch

[root@ctr-rdo-kilo ]# tail -f /var/log/horizon/horizon.log
2015-05-20 15:55:31,704 11818 WARNING django.request Not Found: /dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff
2015-05-20 15:55:32,256 11817 WARNING django.request Not Found: /dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.ttf
2015-05-20 15:56:51,490 11818 WARNING django.request Not Found: /dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff
2015-05-20 15:56:51,632 11818 WARNING django.request Not Found: /dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.ttf
2015-05-21 10:00:29,604 11819 WARNING django.request Not Found: /dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff
2015-05-21 10:00:29,648 11819 WARNING django.request Not Found: /dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.ttf
2015-05-21 10:00:33,632 11819 INFO openstack_auth.forms Login successful for user "admin".
2015-05-21 10:00:33,662 11819 ERROR django.request Internal Server Error: /dashboard/auth/login/
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openstack_auth/views.py", line 111, in login
    **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/contrib/auth/views.py", line 51, in login
    auth_login(request, form.get_user())
  File "/usr/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 102, in login
    if _get_user_session_key(request) != user.pk or (
  File "/usr/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 "/usr/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 969, in to_python
    params={'value': value},
ValidationError: [u"'90704a0fbaca4b40b38bcf90121bba02' value must be an integer."]

Comment 8 Ido Ovadia 2015-05-21 13:05:57 UTC
Failed QA
==========
python-django-openstack-auth-1.2.0-2.el7ost.noarch

Comment 9 Matthias Runge 2015-05-22 17:35:44 UTC
Until this lands in repos, folks can fetch the fixed package from
http://cbs.centos.org/koji/buildinfo?buildID=1256

Comment 10 Alan Pevec (Fedora) 2015-05-26 09:27:30 UTC
RDO update: https://review.gerrithub.io/234335

Comment 11 Sascha Spreitzer (Red Hat) 2015-09-15 09:12:35 UTC
Hi I am running most current openstack-kilo with public python-django-openstack-auth-1.2.0-4.el7.noarch. Problem persists..

Can we please reopen the bug?

Comment 12 Matthias Runge 2015-09-15 10:34:04 UTC
You're seeing a different issue.

one patch in kilo python-django-openstack-auth was replaced by the version from upstream, which re-introduced the issue.

This is currently being investigated upstream
https://review.openstack.org/#/c/222478/

Once this has been solved, I'll pull in the patch.

Comment 13 Sascha Spreitzer (Red Hat) 2015-09-15 12:37:52 UTC
Ah thanks!

Comment 14 Tyler Wilson 2015-10-01 17:35:22 UTC
(In reply to Matthias Runge from comment #12)
> You're seeing a different issue.
> 
> one patch in kilo python-django-openstack-auth was replaced by the version
> from upstream, which re-introduced the issue.
> 
> This is currently being investigated upstream
> https://review.openstack.org/#/c/222478/
> 
> Once this has been solved, I'll pull in the patch.

Looks like that has been merged, whats the ETA on this hitting RDO?

Comment 15 Matthias Runge 2015-10-02 06:15:27 UTC
I would expect this to land in RDO when 2015.1.2 was released, there is another patch for horizon required, which has been merged for liberty. There was a bit fall-out around the patch.

Comment 16 Christopher Brown 2015-10-02 08:27:00 UTC
Hi. I have attempted to apply the patch but I'm still getting the same error. Is there anywhere I can pull in a quick fix from?
Thanks

Comment 17 Matthias Runge 2015-10-02 08:28:22 UTC
Christopher, this requires at least 3 patches in total, in Horizon and for python-django-openstack-auth.

Comment 18 Christopher Brown 2015-10-02 11:36:25 UTC
Thanks Matthias.
It's currently a bit of a problem for PoC environments for clients.
Any workarounds appreciated.
I've tried extending the SESSION_TIMEOUT value but this doesn't appear to be helping, possibly hitting some keystone limit?

Comment 19 Matthias Runge 2015-10-02 12:11:11 UTC
I built a testing django-openstack-auth here:
https://copr-be.cloud.fedoraproject.org/results/mrunge/Horizon-Kilo/epel-7-x86_64/00122406-python-django-openstack-auth/python-django-openstack-auth-1.2.0-6.el7.centos.noarch.rpm

Apparently two changes to /etc/openstack-dashboard/local_settings are required:
adding: 
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

(make sure, you have a cache configured. Packstack does that, for example.
and
AUTH_USER_MODEL = 'openstack_auth.User'

This is something like a workaround, but shouldn't do any harm.

Comment 20 Fedora Update System 2015-10-15 19:37:33 UTC
python-django-openstack-auth-1.2.0-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-ab182d465e

Comment 21 Fedora Update System 2015-10-16 03:02:53 UTC
python-django-openstack-auth-1.2.0-6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update python-django-openstack-auth'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-ab182d465e

Comment 22 Alan Pevec (Fedora) 2015-10-28 21:57:32 UTC
python-django-horizon-2015.1.2-1.el7 and python-django-openstack-auth-1.2.0-6.el7 are in the RDO Kilo testing repo:
http://cbs.centos.org/repos/cloud7-openstack-kilo-testing/x86_64/os/

Comment 23 Matthias Runge 2015-10-28 23:40:42 UTC
Alan, what is the reason you added FailedQA here?

Comment 24 Fedora Update System 2015-11-02 18:54:31 UTC
python-django-openstack-auth-1.2.0-6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 25 Ido Ovadia 2016-05-09 08:35:28 UTC
Failed QA
=========
python-django-horizon-2015.1.3-2.el7ost.noarch

Comment 27 Matthias Runge 2016-05-09 15:11:32 UTC
Closing this again; If there is a current bug in RDO version of horizon, please file a new bug.