"Error: Bad token, please reauthenticate" going from diablo to essex

Bug #893236 reported by Jesse Andrews on 2011-11-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
High
Gabriel Hurley

Bug Description

It appears session objects corrupt when you move between releases of dashboard.

When I try to login to essex dash after upgrading from diablo I see: Error: Bad token, please reauthenticate

And similarly I see in diablo: Unauthorized at /dash/
Bad token, please reauthenticate (HTTP 401)

----

document.cookie is "csrftoken=8100158035d0b7df3597d6bffd43dbc0; sessionid=e4310acc0d31af252ea027d1b8f9c851"

-----

Steps:

1) install diablo devstack
2) login to dashboard
3) upgrade horizon to essex
4) open new tab and go to your dash url - it will show you the login page
5) try to login

Expected:

Either it lets the old token work (and recognizes who I am) or lets me login again

Actual:

I cannot login as long as I have my cookie. Even after many days (maybe a week), the cookie still causes issues (if you don't delete the cookie manual the dashboard doesn't remove it and it doesn't appear to timeout.

If I create an incognito tab (eg, a tab without an existing cookie/session), I am able to login.

Jesse Andrews (anotherjesse) wrote :
Jesse Andrews (anotherjesse) wrote :
Jesse Andrews (anotherjesse) wrote :

notice that:

* essex sees the existing session when logging in but doesn't redirect to /nova
* diablo recognizes the session exists and sends you to /dash

This is probably because of https://bugs.launchpad.net/horizon/+bug/893219

termie (termie) wrote :

Are we using the built in auth decorators? i think they do some of this stuff already, but worst case we can write our own decorator that catches the error and calls the logout_then_login view:

django.contrib.auth.views.logout_then_login(request)

Devin Carlen (devcamcar) on 2011-11-22
Changed in horizon:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → termie (termie)
milestone: none → essex-2
Jesse Andrews (anotherjesse) wrote :

removed termie as he is gone for a week - and this is a VERY annoying bug.

It also appears when I reinstall my server (essex -> essex)

Changed in horizon:
assignee: termie (termie) → nobody
Jesse Andrews (anotherjesse) wrote :

Hmm, I might have been able to fix this by going to /auth/logout/ (even though I couldn't go to /nova

Will test next time I have a repro

Devin Carlen (devcamcar) on 2011-12-06
Changed in horizon:
assignee: nobody → termie (termie)
termie (termie) wrote :

well, this bug has turned into a 'refactor how exceptions are handled' bug

Gabriel Hurley (gabriel-hurley) wrote :

There have been a couple fixes that affected this issue since the ticket was opened. I've tried switching between diablo and essex devstack installs with no problems. I'm closing as fixed until proven otherwise. Feel free to reopen with further detail if the problem can still be replicated with the E2 milestone code.

Changed in horizon:
assignee: termie (termie) → Gabriel Hurley (gabriel-hurley)
status: Confirmed → Fix Committed
Thierry Carrez (ttx) on 2011-12-14
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in horizon:
milestone: essex-2 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers