Bug 1236620 - Project drop down doesn't display available projects in kilo
Summary: Project drop down doesn't display available projects in kilo
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-django-openstack-auth
Version: 7.0 (Kilo)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z1
: 7.0 (Kilo)
Assignee: Matthias Runge
QA Contact: Ido Ovadia
URL:
Whiteboard:
: 1247245 (view as bug list)
Depends On:
Blocks: 1172300
TreeView+ depends on / blocked
 
Reported: 2015-06-29 14:47 UTC by praveen madire
Modified: 2023-02-22 23:02 UTC (History)
13 users (show)

Fixed In Version: python-django-openstack-auth-1.2.0-4.el7ost
Doc Type: Bug Fix
Doc Text:
A bug discovered in django_openstack_auth made token handling with PKI tokens unreliable. As a result, a user could not access his projects, project selectors stayed empty. With this update, token handling is fixed and users can access their projects.
Clone Of:
Environment:
Last Closed: 2015-09-03 17:36:53 UTC
Target Upstream Version:
Embargoed:
scohen: needinfo+


Attachments (Terms of Use)
Project drop down doesn't display available projects (72.11 KB, application/zip)
2015-06-29 14:47 UTC, praveen madire
no flags Details
User role list (63.72 KB, image/png)
2015-06-30 11:59 UTC, praveen madire
no flags Details
screenshots describe the admin rights issue with creating an instance (403.55 KB, application/pdf)
2015-08-07 12:33 UTC, Audra Cooper
no flags Details


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 215103 0 None MERGED initialize the hasher for unscoped token 2020-10-01 07:39:08 UTC
Red Hat Product Errata RHBA-2015:1721 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Bug Fix and Enhancement Advisory 2015-09-03 21:36:25 UTC

Description praveen madire 2015-06-29 14:47:21 UTC
Created attachment 1044382 [details]
Project drop down doesn't display available projects

Description of problem:


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


How reproducible:


Steps to Reproduce:
1.Install Kilo version of Redhat Openstack
2.Login to Horizon dashboard as an admin user
3.create a project through identity menu
4.Create a new user and add this user as  a member to the above project
5.login as a above user to horizon dashboard
6.click on Project menu->Instances ->Launch instance

Actual results:Projects should be displayed


Expected results:Available projects are not displayed


Additional info:This is a blocking defect,without fixing this we can't create VM's through Horizon dashboard

Comment 3 Matthias Runge 2015-06-30 11:40:34 UTC
how did you deploy? I see this working on a packstack setup, following above steps.
(create a new project, create a new user, add that project as the default project for that user).

could you please add the output of openstack user role list <newuser> ?

Which keystone version are you using?

Comment 4 praveen madire 2015-06-30 11:59:38 UTC
Created attachment 1044670 [details]
User role list

I have added a screenshot which shows you the new project (Test Project) and added members to that project(Praveen) and their roles(member/admin etc..)

Comment 5 Matthias Runge 2015-06-30 12:08:35 UTC
I'm still unable to reproduce it.

What keystone version are you using? Is there a reason to add all service users to that project?

Comment 6 praveen madire 2015-06-30 12:28:37 UTC
I am using Dell reference architecture to deploy Redhat openstack,team here automated the deployment process so I am using automated deployment framework to install Redhat openstack.

Here is the Keystone versions:


openstack-keystone-2015.1.0-1.el7ost.noarch
python-keystonemiddleware-1.5.1-1.el7ost.noarch
python-keystone-2015.1.0-1.el7ost.noarch
python-keystoneclient-1.3.0-1.el7ost.noarch

Comment 7 praveen madire 2015-06-30 12:35:54 UTC
Hi Matthias,

There is no particular reason to add all service users,i have removed all other service users now apart from new user(praveen) then logged back in to Horizon using praveen credentials but still Project name is not showing in Project drop down list.

I can have a skype call and show you the issue if that helps .

Comment 8 Matthias Runge 2015-06-30 12:39:00 UTC
keystone features differ somewhat from API version to API version. keystone from rhos 7 (and earlier) supports both versions.

Currently, I need to figure out, if it's a deployment issue, a usage issue or a horizon issue. Unfortunately, this doesn't give any hints.

Comment 10 Matthias Runge 2015-07-01 14:52:43 UTC
This issue blocks launching instances

Workaround: remove admin role from user. Then everything works as expected.

Comment 11 Chandra Ganguly 2015-07-30 00:26:29 UTC
Moving it to High because  a User of multiple projects is not able to switch tenants without the project drop down menu

Comment 12 Matthias Runge 2015-08-04 13:48:05 UTC
*** Bug 1247245 has been marked as a duplicate of this bug. ***

Comment 13 Jon Schlueter 2015-08-04 17:13:43 UTC
I was trying to recreate this bug and ran into what I think is part of the issue I have 2 projects with instances in both projects but from the projects page I can't see which project I'm looking at and don't see the VM that is running in the second project in the overview or instances list.

Steps to reproduce:
1. Clean install
2. New User
3. New project test
4. Add new user to test project
5. Make sure test project is default for new user
6. Launch instance in test project (log in as new user and launch instance)
7. as admin you can't directly see new instance that was launched under test project.
8, You can see that it's running by browsing to Identify -> projects -> new project -> see quota -> Shows list of Instances running on that project

Also related bug 1240895 deals with showing what project is currently active.

Comment 14 Jon Schlueter 2015-08-04 19:44:24 UTC
clarification of behavior with python-django-horizon-2015.1.0-10.el70st.noarch

If a user has admin role on the active project they get the additional panel for selecting project and user. If they don't have admin role for the active project that panal does not show up.

This still doesn't totally explain the empty project list in the Project & User panel

Comment 15 Audra Cooper 2015-08-04 20:01:59 UTC
(In reply to Jon Schlueter from comment #14)
> clarification of behavior with
> python-django-horizon-2015.1.0-10.el70st.noarch
> 
> If a user has admin role on the active project they get the additional panel
> for selecting project and user. If they don't have admin role for the active
> project that panal does not show up.
> 
> This still doesn't totally explain the empty project list in the Project &
> User panel

SHOULD the user be able to have admin role right or have the Admin user added to the project as a member?  Like you stated, if the project has either of these members you get the additional panel for selecting a project resulting in not being able to create the instance.  Is it just user error and trying to add admin rights and admin member to a project is something that should not be done?

Comment 16 Matthias Runge 2015-08-05 07:46:27 UTC
> SHOULD the user be able to have admin role right or have the Admin user
> added to the project as a member?  Like you stated, if the project has
> either of these members you get the additional panel for selecting a project
> resulting in not being able to create the instance.  Is it just user error
> and trying to add admin rights and admin member to a project is something
> that should not be done?

In my tests, you can add a user to a project with admin role only in that project. You still get the "Project&User" tab in Launch instance dialog.

I get that filled dialog (i.e. you're able to select, in which project you want to launch your instance):
- with a user being only admin on two projects (no _member_ role)
- with a user being only admin in one project (no _member_ role in that project), and _member_ in the other project


I don't get that dialog, when being a user with two projects with _member_ roles only.

I was unable to reproduce the described issue from #c1. 

Since keystone v2 vs. keystone v3 changed significantly, that might matter here. Unfortunately, nobody could tell me, how the system from #c1 was set up.

Looking at the code to collect that information for the drop down box, that is still the same compared to Juno version:

https://github.com/openstack/horizon/blob/stable/juno/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py#L57

vs. 
https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py#L61

Comment 17 Jon Schlueter 2015-08-05 15:06:11 UTC
What authentication setup was used for original setup?

I found a possible sneak path to get empty project list here:

https://github.com/openstack/django_openstack_auth/blob/master/openstack_auth/user.py#L311

If that sneak path was the case there should be exception log entri in the log from this call LOG.exception('Unable to retrieve project list.')

Not sure if this is the cause but thought I'd add this to the conversation and see which version of python-django-openstack-auth was installed and how permissions/authentication relevant to it was setup on the system showing this issue.

Comment 18 Matthias Runge 2015-08-05 20:36:51 UTC
Could you please provide a sos report here?

Is there any exception being logged, when this happens?

Comment 19 praveen madire 2015-08-06 10:23:41 UTC
Hi Matthias,

I don't have any active deployment,will be deploying new instance today then i can able to provide exception logs if there are any-thanks

Comment 20 Audra Cooper 2015-08-07 12:33:22 UTC
Created attachment 1060351 [details]
screenshots describe the admin rights issue with creating an instance

Comment 21 praveen madire 2015-08-07 12:45:28 UTC
Hi Matthias,

Audra told me that she will be having call with you today to discuss about the issues we are seeing .

Comment 22 Adam Young 2015-08-07 14:57:58 UTC
During the debugging session, we found this in the Keystone log;


2015-08-07 14:22:38.220 37833 WARNING keystone.middleware.core [-] RBAC: Invalid token

2015-08-07 14:22:38.221 37833 WARNING keystone.common.wsgi [-] The request you have made requires authentication.

2015-08-07 14:22:38.222 37833 INFO eventlet.wsgi.server [-] 192.168.140.183 - - [07/Aug/2015 14:22:38] "GET /v2.0/tenants HTTP/1.1" 401 405 0.014434

The token handed from Horizon to Keystone for the token list is invalid.  It might be an artifact of the "hash to save space" that Horizon does, although we have not seen that as a problem before.

As a check, Audra switch the token provider from pki to uuid, restarted the Keystone server, and the project dropdown for the VM lauch was indeed populated, and she was able to launch VMs.

Switch the token provider to UUID tokens should have no negative impact and may even have a slight performance benefit.  Still, the root cause is not clearly identified here.  If the tokens were never valid, Horizon should not be able to perform any actions against any of the services, to include things like listing existing VMs.  So, at some point, the tokens are either getting invalidated somehow.

Comment 23 Adam Young 2015-08-07 15:14:03 UTC
configuration change was to comment out the pki provider and enable the uuid provider and restart keystone.

[token]
#provider = keystone.token.providers.pki.Provider
provider = keystone.token.providers.uuid.Provider

Comment 26 Matthias Runge 2015-08-11 11:26:15 UTC
Just to make it clear, this is a config issue and not an issue with the package. It should be probably reported against the used installer.

Comment 27 Audra Cooper 2015-08-11 16:45:59 UTC
After applying the configuration change noted in C23 above and applying the patch (0001-Add-projects-switcher-region-switcher-to-RCUE.patch) from BZ 1240895, both the Projects dropdown list in the Dashboard and Projects dropdown on the Launch Instance form are now populated.

Comment 28 Matthias Runge 2015-08-11 17:51:57 UTC
OK, now that I know how to reproduce, I was able to create the same issue for me in a different install.
(just switch to PKI tokens in keystone)

Comment 30 Matthias Runge 2015-08-13 13:32:49 UTC
in my tests, I can confirm, the issue is in django-openstack-auth and not on the keystone side.

It looks like horizon uses a wrong and/or hashed token.

I filed https://bugs.launchpad.net/django-openstack-auth/+bug/1484499

Comment 31 Matthias Runge 2015-08-20 11:59:38 UTC
I proposed a patch upstream

How to test:

1. create a user in TWO projects.
2. switch keystone to use pki tokens
/etc/keystone/keystone.conf
set:
provider = keystone.token.providers.pki.Provider
where provider was 
provider = keystone.token.providers.uuid.Provider

3. restart keystone or httpd (depending on deployment method)
4. log that user from 1. into horizon
5. the project switcher on upper corner should be populated and should show the project names

Comment 32 Matthias Runge 2015-08-23 19:25:48 UTC
Upstream patch for django-openstack-auth was merged upstream. It will be contained in d-o-a version 1.3.2. 

This currently blocks using horizon in all installs using pki tokens.

Backport is simple

Comment 38 Ido Ovadia 2015-09-03 07:57:26 UTC
Verified
========
python-django-openstack-auth-1.2.0-4.el7ost.noarch

Comment 40 errata-xmlrpc 2015-09-03 17:36:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2015:1721


Note You need to log in before you can comment on or make changes to this bug.