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

Bug 1547050

Summary: NPE while asking for host statistics
Product: [oVirt] ovirt-engine Reporter: Tomas Jelinek <tjelinek>
Component: RestAPIAssignee: Ondra Machacek <omachace>
Status: CLOSED CURRENTRELEASE QA Contact: Radim Hrazdil <rhrazdil>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.1.2CC: bugs, fkrepins, lsvaty, mperina
Target Milestone: ovirt-4.2.2Flags: rule-engine: ovirt-4.2+
Target Release: ---   
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-03-29 11:08:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine logs none

Description Tomas Jelinek 2018-02-20 12:29:55 UTC
Created attachment 1398217 [details]
engine logs

Description of problem:
while calling:
curl -k -X GET -u "admin@internal:<password>" -H "Content-type: application/xml" -H "Accept: application/xml" https://<host>/ovirt-engine/api/hosts?follow=statistics

I get as a result an internal server error. In engine log I see this:
2018-02-20 13:17:36,288+01 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-113) [] Operation Failed: null
2018-02-20 13:17:36,288+01 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-113) [] Exception: java.lang.NullPointerException
	at org.ovirt.engine.api.restapi.resource.HostStatisticalQuery.getStatistics(HostStatisticalQuery.java:63) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.HostStatisticalQuery.getStatistics(HostStatisticalQuery.java:13) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.BackendStatisticsResource.list(BackendStatisticsResource.java:44) [restapi-jaxrs.jar:]


Version-Release number of selected component (if applicable):
ovirt-engine-4.2.2-0.0.master.20180108193417.git45b0275.el7.centos.noarch

Additional info:
It did work on my local setup so it must be something specific with the setup.

Comment 2 Filip Krepinsky 2018-02-20 15:37:50 UTC
btw it is happening because of this host ob brq-dev: 

https://brq-dev.rhev.lab.eng.brq.redhat.com/ovirt-engine/api/hosts/68c74cda-6580-474e-afd8-a34e23749cb1?follow=statistics

Comment 3 Radim Hrazdil 2018-03-07 08:53:40 UTC
Verified that using the API request in the description doesn't lead to Nullpointer Exception.

Software Version:4.2.2.2-0.1.el7

Comment 4 Sandro Bonazzola 2018-03-29 11:08:47 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE.

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