Bug 1347709

Summary: When reading hawkular metrics, user receives a TypeError Exception.
Product: Red Hat CloudForms Management Engine Reporter: Chris Pelland <cpelland>
Component: ProvidersAssignee: Yaacov Zamir <yzamir>
Status: CLOSED ERRATA QA Contact: Einat Pacifici <epacific>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.6.0CC: jfrey, jhardy, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: container
Fixed In Version: 5.6.0.12 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-29 16:07:48 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:

Description Chris Pelland 2016-06-17 12:35:10 UTC
What happens:
If the Hawkular data struct is empty we get an the error.

What should happen:
We should check for empty data structs.

Examples:
Full data struct:

{"start"=>1464856440000,
  "end"=>1464856460000,
  "min"=>13548162076446.0,
  "avg"=>13548162076446.0,
  "median"=>13548162076446.0,
  "max"=>13548162076446.0,
  "sum"=>13548162076446.0,
  "samples"=>1,
  "empty"=>false}
Empty data struct:
{"start"=>1464856460000, "end"=>1464856480000, "empty"=>true}

This Exception can be reproduced by running:
ContainerNode.first.perf_capture('realtime') on a node with some empty data.

Comment 3 Oleg Barenboim 2016-06-20 18:49:17 UTC
Merged and backported https://github.com/ManageIQ/manageiq/pull/9097 to Darga.

Comment 4 CFME Bot 2016-06-20 18:50:53 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/26d8625cba33ca8bcd6806335ba6c752c821c0d5

commit 26d8625cba33ca8bcd6806335ba6c752c821c0d5
Author:     Yaacov Zamir <yzamir>
AuthorDate: Thu Jun 2 11:40:32 2016 +0300
Commit:     Yaacov Zamir <yzamir>
CommitDate: Sun Jun 19 14:13:04 2016 +0300

    When reading hawkular metrics we can get a TypeError Exception.
    
    What happen:
    If the Hawkular data struct is empty we get an the error.
    What should happen:
    We should check for empty data structs.
    
    Issue:
    https://github.com/ManageIQ/manageiq/issues/9096
    
    Bugzilla:
    https://bugzilla.redhat.com/show_bug.cgi?id=1347709

 .../kubernetes/container_manager/metrics_capture/capture_context.rb     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 5 Yaacov Zamir 2016-06-26 14:01:18 UTC
Information about version of hawkular:

Version 0.8.0 of hawkular will not fail on TypeError Exception when reading metrics.

Version 0.17.0 of hawkular will fail on TypeError Exception when reading metrics.


Examples:
---------------------------
Version of hawkular 0.8.0.Final-redhat-1:

Retruen when asked /status:
{"MetricsService":"STARTED","Implementation-Version":"0.8.0.Final-redhat-1","Built-From-Git-SHA1":"826f08dd34912ad455a4cb2b34f2e79cd79ace9a"}

Return when asked for /metrics/counters/machine%2Fose-node1.qa.lab.tlv.example.com%2Fnetwork%2Frx/data/?bucketDuration=20s&start=1466944540000:

[ .... {
    "start": 1466949340000,
    "end": 1466949360000,
    "min": "NaN",
    "avg": "NaN",
    "median": "NaN",
    "max": "NaN",
    "percentile95th": "NaN",
    "samples": 0,
    "empty": true
} ... ]

---------------------------
Version of hawkular 0.17.0-SNAPSHOT:

Retruen when asked /status:
{"MetricsService":"STARTED","Implementation-Version":"0.17.0-SNAPSHOT","Built-From-Git-SHA1":"56ede2a1bf69da749b4e7092b4b8ed7a399e8f2f"}

Return when asked for /metrics/counters/machine%2Fose-node1.qa.lab.tlv.example.com%2Fnetwork%2Frx/data/?bucketDuration=20s&start=1466944540000:

[ .... {
    "start": 1466949340000,
    "end": 1466949360000,
    "empty": true
} ... ]

Comment 6 Yaacov Zamir 2016-06-27 10:29:23 UTC
how to reproduce:

1. use an openshift/kubernetes provider with hawkular version 0.17.0.
2. read metrics.

what happen:
no metrics

what should happen:
metrics are read

fixed by (already merged):
https://github.com/ManageIQ/manageiq/pull/9097

Comment 8 errata-xmlrpc 2016-06-29 16:07:48 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-2016:1348