Bug 1518538

Summary: Wrong project names on Ad Hoc matrics page cause to internal server error
Product: Red Hat CloudForms Management Engine Reporter: Shalom Naim <snaim>
Component: ProvidersAssignee: Yaacov Zamir <yzamir>
Status: CLOSED CURRENTRELEASE QA Contact: Einat Pacifici <epacific>
Severity: high Docs Contact:
Priority: urgent    
Version: 5.9.0CC: cpelland, epacific, gblomqui, jfrey, jhardy, lavenel, obarenbo, simaishi, yzamir
Target Milestone: GAKeywords: TestOnly
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: containers
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1520614 1523256 1523774 (view as bug list) Environment:
Last Closed: 2018-06-21 21:15:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Container Management Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1520614, 1523774    
Attachments:
Description Flags
demo
none
bug verification none

Description Shalom Naim 2017-11-29 07:04:55 UTC
Created attachment 1360186 [details]
demo

Description of problem:
Wrong project names available in Ad hoc metrics drop-down list

When navigating to Ad-Hoc matrics page (Compute --> Containers --> Providers)
and going to the Ad-hoc metrics page, on the dropdown list you will see wrong project names.

The names that appear seem like concatenation of real project names with some UUID 

after selecting a project and click on set context, an error flash message shows up


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

How reproducible:
CFME Version:            5.9.0.11


Steps to Reproduce:
1. Navigate to provider page (Compute --> Containers --> Providers), and select your provider
2. On the upper toolbar Click on configuration button and select Ad-Hoc metrics
3. Select a project from the project list (Here you can see the wrong names)
4. Click on set context

Actual results:
No matrics shows up

Expected results:
matrics have to show up

Additional info:

After investigating the issue with yzamir we found that this issue may caused by wrong naming on the OCP side

[root@snaim-ocp-3-7-master ~]# curl -k -H "Hawkular-Tenant: $HAWKULAR_TENANT" -H "Authorization: Bearer $HAWKULAR_TOKEN"  https://$HAWKULAR_HOST/hawkular/metrics/tenants

[{"id":"_hawkular_admin"},{"id":"_system"},{"id":"openshift-infra:633c4640-d425-11e7-a6bf-001a4a490032"},{"id":"test-project:40fb82cb-d448-11e7-a4c6-001a4a490032"},{"id":"openshift-metrics:405e61b3-d432-11e7-a6bf-001a4a490032"},{"id":"default:63425785-d425-11e7-a6bf-001a4a490032"}][root@snaim-ocp-3-7-master ~]# 
[root@snaim-ocp-3-7-master ~]# 

[root@snaim-ocp-3-7-master ~]# oc version
oc v3.7.0
kubernetes v1.7.0+695f48a16f
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://snaim-ocp-3-7-master.cfme2.lab.eng.rdu2.redhat.com:8443
openshift v3.7.0
kubernetes v1.7.0+695f48a16f
[root@snaim-ocp-3-7-master ~]#

Comment 2 Shalom Naim 2017-11-29 07:06:48 UTC
How reproducible:
100%

Comment 3 Yaacov Zamir 2017-11-29 08:51:27 UTC
a. The fix for the UI is trivial
b. The underlying bug is in Hawkualr (*) and the UI is correctly showing the wrong data it gets from Hakular's API.

We need PM advice:
Do we fix the UI and hide the underliying bug in Hawkular ?
Or
Do we wait for a fix in Hawkular, that may not be in time for users using the buggy versions Hawkular.

(*) according to Hawkular API documentation the query should return a list of "tenant_names", the "tenants_name:hash" returned value not as advertised.

http://www.hawkular.org/docs/rest/rest-metrics.html#_tenant

Comment 10 Yaacov Zamir 2017-11-29 12:44:38 UTC
Opened a POC on how we can work around this in the UI:
https://github.com/ManageIQ/manageiq-ui-classic/pull/2860

this patch is not for use, just to show we can work around this if we need to.

Comment 16 Yaacov Zamir 2017-12-04 14:23:11 UTC
submitted upstream (a fix on manageiq side)
https://github.com/ManageIQ/manageiq-ui-classic/pull/2860

Comment 17 Yaacov Zamir 2017-12-04 17:19:38 UTC
merged upstream (a fix on manageiq side)
https://github.com/ManageIQ/manageiq-ui-classic/pull/2860

Comment 21 Shalom Naim 2018-01-01 12:54:40 UTC
Created attachment 1375148 [details]
bug verification