Not authorized when logout and login creating an instance

Bug #1599870 reported by Marcos Lobo
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
django-openstack-auth
Fix Released
Undecided
Jose Castro Leon

Bug Description

When I launch an instance and after that I logout in Horizon and login again, at some point the instance will go to ERROR state due to an authentication error.

How to reproduce:
1. Login in Horizon
2. Launch a new instance. It will keep in some state of the creation workflow, like NETWORKING (Nova).
3. Logout from Horizon and login again
4. You will see the instance in the same state than before to logout
5. The instance workflow change to other state, like SPAWING (Glance)
6. Horizon raises an error: "Failed to perform requested operation on instance ... Not authorized for image ..."

The description is:
- When to login into Horizon and launch a new instance, that instance starts the instance creation workflow with your current token, let's name it TOKEN_A.
- Then, when you logout -> login, you have a new token, TOKEN_B. Why? because django_openstack_auth deletes the token [1] from Keystone when you logout from Horizon.
- So, we are in Horizon again with a new token (TOKEN_B) and the status of the instance is the same than before (NETWORKING), it didn't move forward yet.
- When a new step of the instance creation workflow happens, like SPAWING, that new step will ask for the TOKEN_A (because the instance creation started with TOKEN_A) to Keystone... but there is no TOKEN_A any more, we have TOKEN_B because TOKEN_A was deleted from Keystone when we logout.
-- In this example, Nova started working with TOKEN_A and, for SPAWING task, Nova sent the request (with TOKEN_A) to Glance. Glance get TOKEN_A and tries to authenticate to Keystone with it. Keystone says: There is no TOKEN_A anymore.
- So, authentication fails.

[1] https://github.com/cernops/django_openstack_auth/blob/cern/liberty/openstack_auth/views.py#L185

Revision history for this message
Marcos Lobo (marcos-fermin-lobo) wrote :

I would suggest add a configuration parameter to "disable" the delete_token call.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to django_openstack_auth (master)

Fix proposed to branch: master
Review: https://review.openstack.org/340689

Changed in django-openstack-auth:
assignee: nobody → Jose Castro Leon (jose-castro-leon)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to django_openstack_auth (master)

Reviewed: https://review.openstack.org/340689
Committed: https://git.openstack.org/cgit/openstack/django_openstack_auth/commit/?id=a8c273f85b7aaa89f35c6bbffd76e4a592b62e16
Submitter: Jenkins
Branch: master

commit a8c273f85b7aaa89f35c6bbffd76e4a592b62e16
Author: Jose Castro Leon <email address hidden>
Date: Tue Jul 12 07:49:26 2016 +0200

    Not authorized when logout and creating instance

    Add TOKEN_DELETE_DISABLED to the settings so when can customize
    the revocation of tokens on user logout or switch. This solves an
    issue when a user launches a long running operation and then logs off
    resulting in an error if the operation tries to validate the token

    Change-Id: Ic693c563e028081d87b6447b95ac94608da2dafb
    Closes-Bug: 1599870

Changed in django-openstack-auth:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/django_openstack_auth 2.4.0

This issue was fixed in the openstack/django_openstack_auth 2.4.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.