Bug 1523256

Summary: Wrong project names on Ad Hoc matrics page cause to internal server error
Product: Red Hat CloudForms Management Engine Reporter: Nimrod Shneor <nshneor>
Component: ProvidersAssignee: Bronagh Sorota <bsorota>
Status: CLOSED DEFERRED QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.8.0CC: cpelland, epacific, gblomqui, jfrey, jhardy, lavenel, obarenbo, simaishi, snaim, yzamir
Target Milestone: GA   
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: containers
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1518538 Environment:
Last Closed: 2017-12-07 14:30:38 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:

Description Nimrod Shneor 2017-12-07 14:26:07 UTC
+++ This bug was initially created as a clone of Bug #1518538 +++

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 ~]#

--- Additional comment from Shalom Naim on 2017-11-29 02:06:48 EST ---

How reproducible:
100%

--- Additional comment from Yaacov Zamir on 2017-11-29 03:51:27 EST ---

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

--- Additional comment from Yaacov Zamir on 2017-11-29 07:44:38 EST ---

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.

--- Additional comment from Yaacov Zamir on 2017-12-04 09:23:11 EST ---

submitted upstream (a fix on manageiq side)
https://github.com/ManageIQ/manageiq-ui-classic/pull/2860

--- Additional comment from Yaacov Zamir on 2017-12-04 12:19:38 EST ---

merged upstream (a fix on manageiq side)
https://github.com/ManageIQ/manageiq-ui-classic/pull/2860