Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1360940

Summary: Regression: User list as project admin after IDM integration from Horizon dashboard logging out user and sending him/her back to the login page
Product: Red Hat OpenStack Reporter: Andreas Karis <akaris>
Component: python-django-horizonAssignee: Radomir Dopieralski <rdopiera>
Status: CLOSED WONTFIX QA Contact: Ido Ovadia <iovadia>
Severity: high Docs Contact:
Priority: high    
Version: 7.0 (Kilo)CC: akaris, athomas, beth.white, mrunge, srevivo
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: 8.0 (Liberty)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 14:42:05 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: 1287586    
Bug Blocks:    
Attachments:
Description Flags
failed login redirect
none
01-after-clocking-on-groups.png
none
00-brefore-clicking-on-groups.png
none
02-login-without-clear-cache
none
03-need-to-use-private-mode-to-login-again
none
behavior with older packaes in OSP 7 none

Description Andreas Karis 2016-07-27 23:17:20 UTC
Regression:

From python-django-horizon-2015.1.2-4.el7ost.noarch -> python-django-horizon-2015.1.3-3.el7ost.noarch, also affects python-django-horizon-2015.1.4-1.el7ost.noarch

Changelog:

[root@overcloud-controller-0 ~]# rpm -qp --changelog python-django-horizon-2015.1.3-3.el7ost.noarch.rpm | head -n40
* Fri May 13 2016 Itxaka Serrano <itxaka> - 2015.1.3-3
-  python-django-horizon-2015.1.3-2.el7ost breaks portal after 
forced inactivity logout (rhbz#1334405)

* Mon May 02 2016 Matthias Runge <mrunge> - 2015.1.3-2
- Unable to upload objects to object storage using IE 11 (rhbz#1326869)
- Refresh the networks on ajax update (rhbz#1289388)
- Logout user if he has no valid tokens (rhb#1233454)
- Heat Stacks Details: Events table doesn't show up (rhbz#1319038)
- Remove serial console hardcode url (rhbz#1244516)
- Fix need to click twice to open Red Hat Access (rhbz#1283121)
- Add policy check for project detail link (rhbz#1326146)
- Add missing content-length header (rhbz#1314698)
- Make Port Details VNIC type translatable (rhbz#1026237)

* Thu Feb 18 2016 Matthias Runge <mrunge> - 2015.1.3-1
- rebase to 2015.1.3 (rhbz#1305906)
- When sorting by instance size, it's not sorted the right way (rhbz#1292734)
- Horizon should accept an IPv6 address as a VIP Address for LB Pool
  (rhbz#1305021)
- Fix FWaaS Rules table displaying (rhbz#1291996)
- make test suite pass, missing backports (rhbz#1288470)

* Tue Dec 08 2015 Matthias Runge <mrunge> - 2015.1.2-4
- Horizon - Launch instance on admin project internal server error
  (rhbz#1288652)
- Update metadata dialog empty (rhbz#1282765)
- serial consoles not exposed (rhbz#1168359)

Where this likely happened (this is pure speculation):

* Fri May 13 2016 Itxaka Serrano <itxaka> - 2015.1.3-3
-  python-django-horizon-2015.1.3-2.el7ost breaks portal after 
forced inactivity logout (rhbz#1334405)

Description of issue:

In python-django-horizon-2015.1.2-4.el7ost.noarch, we run into https://bugzilla.redhat.com/show_bug.cgi?id=1332325  --  
I logged in as admin and specified "default" domain on login page. When I select Identity->Users or Identity->Groups I got pop-up error message saying "Error: Unauthorized: Unable to retrieve user/group list."

In python-django-horizon-2015.1.3-3.el7ost.noarch.rpm, instead of showing this error message, the user is logged out of horizon and gets a 302 redirect back to the login page.

Comment 2 Andreas Karis 2016-07-27 23:19:43 UTC
This is an issue, because there is no error message at all which is presented to the user. Even the state of https://bugzilla.redhat.com/show_bug.cgi?id=1332325  provided more useful output / information to the user.

Comment 3 Andreas Karis 2016-07-27 23:22:24 UTC
In order to log into the dashboard again after this happens, user needs to use private browsing or delete brwoser cache

Comment 4 Andreas Karis 2016-07-27 23:22:47 UTC
Here is the error message from horizon logs:


2016-07-27 23:22:13,237 17593 ERROR horizon.exceptions Unauthorized: The request you have made requires authentication. (Disable debug mode to suppress these details.) (HTTP 401) (Request-ID: req-cc1c5a4c-5d2e-4cb1-bb6e-f2622ce41647)
Traceback (most recent call last):
  File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/identity/users/views.py", line 55, in get_data
    domain=domain_context)
  File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/api/keystone.py", line 310, in user_list
    users = keystoneclient(request, admin=True).users.list(**kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/utils.py", line 318, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/v3/users.py", line 108, in list
    **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/base.py", line 73, in func
    return f(*args, **new_kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/base.py", line 361, in list
    self.collection_key)
  File "/usr/lib/python2.7/site-packages/keystoneclient/base.py", line 113, in _list
    resp, body = self.client.get(url, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/adapter.py", line 170, in get
    return self.request(url, 'GET', **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/adapter.py", line 206, in request
    resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/adapter.py", line 95, in request
    return self.session.request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/utils.py", line 318, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/session.py", line 397, in request
    raise exceptions.from_response(resp, method, url)
Unauthorized: The request you have made requires authentication. (Disable debug mode to suppress these details.) (HTTP 401) (Request-ID: req-cc1c5a4c-5d2e-4cb1-bb6e-f2622ce41647)

Comment 5 Andreas Karis 2016-07-27 23:24:22 UTC
Created attachment 1184840 [details]
failed login redirect

Comment 16 Andreas Karis 2016-08-17 13:58:19 UTC
I retested in a new reproducer environment, here are the instructions to reproduce what's happening in this ticket. I will post the instructions for a downgrade and screenshots for comparison after that


========================================================================

I tested again in a lab:

How to reproduce:

1.8. Configure Identity Service

These steps prepare Identity Service for integration with AD DS.
1.8.1. Enable command line access to keystone v3

To manage Identity Service domains from the command line, you need to enable access to keystone v3. Perform this procedure from the controller running Identity Service:

1. Create a copy of the existing keystonerc_admin file:

# cp keystonerc_admin keystonerc_admin_v3

2. Edit the new keystonerc_admin_v3 file. Change OS_AUTH_URL from v2.0 to v3:

export OS_AUTH_URL=http://controllerIP:5000/v3/

Add the following entries to the bottom of keystonerc_admin_v3.

export OS_IDENTITY_API_VERSION=3
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default

3. Enable these options for your current command line session by sourcing the file:

# source keystonerc_admin_v3

1.8.2. Configure the controller

Perform this procedure from the controller running the keystone service:

1. Configure SELinux:

# setsebool -P authlogin_nsswitch_use_ldap=on

The output might include messages similar to this. They can be ignored:

Full path required for exclude: net:[4026532245].

2. Create the domains directory:

# mkdir /etc/keystone/domains/
# chown keystone /etc/keystone/domains/

3. Configure Identity Service to use multiple back ends:

# openstack-config --set /etc/keystone/keystone.conf identity domain_specific_drivers_enabled true
# openstack-config --set /etc/keystone/keystone.conf identity domain_config_dir /etc/keystone/domains
# openstack-config --set /etc/keystone/keystone.conf assignment driver keystone.assignment.backends.sql.Assignment

Note

If you are using Red Hat OpenStack Platform director, then you will need to be aware that /etc/keystone/keystone.conf is managed by Puppet. Consequently, any custom configuration you add might be overwritten whenever you run the openstack overcloud deploy process. As a result, you might need to re-add this configuration manually each time. It is expected that a future release of director will include the Puppet parameters that will allow you to re-apply these settings automatically using a post-deployment script.

4. Enable multiple domains in dashboard. Add these lines to /etc/openstack-dashboard/local_settings

OPENSTACK_API_VERSIONS = {
    "identity": 3
}
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'

Note

If you are using Red Hat OpenStack Platform director, then you will need to be aware that /etc/openstack-dashboard/local_settings is managed by Puppet. Consequently, any custom configuration you add might be overwritten whenever you run the openstack overcloud deploy process. As a result, you might need to re-add this configuration manually each time. It is expected that a future release of director will include the Puppet parameters that will allow you to re-apply these settings automatically using a post-deployment script.

Restart the keystone and dashboard services to apply the settings:

# systemctl restart openstack-keystone.service
# systemctl restart httpd

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Use the default admin credentials from the default rc file
~~~
[stack@undercloud-6 ~]$ cat overcloudrcv3 
export OS_NO_CACHE=True
export COMPUTE_API_VERSION=1.1
export OS_USERNAME=admin
export no_proxy=,10.0.0.4
export OS_TENANT_NAME=admin
export OS_CLOUDNAME=overcloud
export OS_AUTH_URL=http://10.0.0.4:5000/v3
export NOVA_VERSION=1.1
export OS_PASSWORD=hBdNvMv4rJxu27vb2uGqxuqjz
export OS_IDENTITY_API_VERSION=3
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
~~~

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Go to Identity -> Groups

you will be logged out, can't login again - 302 redirect to the login page

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

use private browsing to login again

Comment 17 Andreas Karis 2016-08-17 13:59:11 UTC
Created attachment 1191639 [details]
01-after-clocking-on-groups.png

Comment 18 Andreas Karis 2016-08-17 13:59:45 UTC
Created attachment 1191640 [details]
00-brefore-clicking-on-groups.png

Comment 19 Andreas Karis 2016-08-17 14:00:11 UTC
Created attachment 1191641 [details]
02-login-without-clear-cache

Comment 20 Andreas Karis 2016-08-17 14:00:37 UTC
Created attachment 1191642 [details]
03-need-to-use-private-mode-to-login-again

Comment 21 Andreas Karis 2016-08-17 14:01:04 UTC
Instructions for downgrading and reproducing from here on

Comment 22 Andreas Karis 2016-08-17 14:24:49 UTC
(by the way, I also reproduced this exact same behavior with OSP 8 python-django-horizon-8.0.1-2.el7ost.noarch)

Comment 23 Radomir Dopieralski 2016-08-17 14:30:58 UTC
Sorry for not making it clear. I'm not saying that the change of behavior comes from Keystone -- it's definitely in Horizon. Apparently there was a fix that made Horizon handle Unauthorized errors properly -- that is, log out the users and let them log in again. However, since the error returned by Keystone is the same as error returned when, for instance, your session expired, I have no way of telling the two apart. I think Keystone should be returning a different error, but I need to talk about this with Keystone devs to make sure my understanding is correct.

I did create an environment and I did reproduce the error, I'm now thinking what we can do to handle it.

Comment 24 Andreas Karis 2016-08-17 15:10:20 UTC
Created attachment 1191661 [details]
behavior with older packaes in OSP 7

Comment 25 Andreas Karis 2016-08-17 16:21:54 UTC
So, for the above, install OSP 7 and upgrade to the latest packages. Then, follow instructions in comment 16, and you will get the behavior as within the screenshots.

Then, execute
~~~
yum downgrade python-django-horizon-2015.1.2-4.el7ost.noarch openstack-dashboard-2015.1.2-4.el7ost.noarch openstack-dashboard-theme-2015.1.2-4.el7ost.noarch
~~~

Once packages are downgraded, you will see the 'old' error message "Unauthorized: Unable to retrieve user list."

I also noticed something: the reason that users can't login anymore is likely due to the fact that on a subsequent login, they automatically log into the last page that they visited? Hense this login -> logout loop.

Also, the issue exists in OSP 8, same thing, admin user is logged out when he goes to Identity -> Users

Comment 26 Andreas Karis 2016-08-17 16:23:09 UTC
Awesome, thanks and sorry for the misunderstanding. I hope that the additional details help. I have a reproducer environment for the day at least, if you need any additional information, let me know.

Comment 28 Radomir Dopieralski 2016-08-26 07:27:08 UTC
I did a little bit of research, and it turns out that mutlidomain support is only officially supported in Horizon starting with OSP9. It's definitely not supported in OSP7.

Comment 29 Ido Ovadia 2016-08-26 11:46:40 UTC
(In reply to Andreas Karis from comment #26)
> Awesome, thanks and sorry for the misunderstanding. I hope that the
> additional details help. I have a reproducer environment for the day at
> least, if you need any additional information, let me know.

In addition to comment 28, the scenario described this bug 
requires support domain scoped tokens in horizon https://bugzilla.redhat.com/show_bug.cgi?id=1287586

Comment 30 Radomir Dopieralski 2018-04-27 10:17:53 UTC
It seems that we can't support this kind of configuration in that version of OSP. Since there has been no answer, I think we should close this issue?

Comment 31 Beth White 2018-10-30 14:42:05 UTC
Closed
Bugs on needinfo > 30d 
Please re-open if needed.