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

Bug 1119812

Summary: SDK crashes when retrieving cluster list
Product: [Retired] oVirt Reporter: Martin Sivák <msivak>
Component: ovirt-engine-sdk-javaAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Ondra Machacek <omachace>
Severity: high Docs Contact:
Priority: high    
Version: 3.5CC: gklein, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: ovirt-engine-sdk-java-3.5.0.2-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1119851 (view as bug list) Environment:
Last Closed: 2014-10-17 12:33:42 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:
Bug Depends On:    
Bug Blocks: 1119851    

Description Martin Sivák 2014-07-15 15:00:38 UTC
Description of problem:

Api engine = ovirtClient.connect();
for (Cluster cluster: engine.getClusters().list()) {

results in

[STDOUT] java.lang.NullPointerException
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxy.injectHeaders(HttpProxy.java:170)
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:113)
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxyBroker.get(HttpProxyBroker.java:414)
[STDOUT]        at org.ovirt.engine.sdk.common.CollectionDecorator.list(CollectionDecorator.java:180)
[STDOUT]        at org.ovirt.engine.sdk.common.CollectionDecorator.list(CollectionDecorator.java:154)
[STDOUT]        at org.ovirt.engine.sdk.decorators.Clusters.list(Clusters.java:75)
[STDOUT]        at org.ovirt.optimizer.service.ClusterDiscovery.getClusters(ClusterDiscovery.java:38)
[STDOUT]        at org.ovirt.optimizer.service.OptimizerServiceBean.discoveryTimeout(OptimizerServiceBean.java:75)
[STDOUT]        at org.ovirt.optimizer.service.OptimizerServiceBean$Proxy$_$$_WeldClientProxy.discoveryTimeout(Unknown Source)
[STDOUT]        at org.ovirt.optimizer.service.DiscoveryTimeout.execute(DiscoveryTimeout.java:18)
[STDOUT]        at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
[STDOUT]        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560)
[STDOUT] 2014-07-15 16:48:57 ERROR ErrorLogger:2460 - Job (DEFAULT.6da64b5bd2ee-cfd784b6-630f-4754-a50a-b10e9e4e731c threw an exception.
[STDOUT] org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
[STDOUT]        at org.quartz.core.JobRunShell.run(JobRunShell.java:218)
[STDOUT]        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560)
[STDOUT] Caused by: java.lang.NullPointerException
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxy.injectHeaders(HttpProxy.java:170)
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:113)
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxyBroker.get(HttpProxyBroker.java:414)
[STDOUT]        at org.ovirt.engine.sdk.common.CollectionDecorator.list(CollectionDecorator.java:180)
[STDOUT]        at org.ovirt.engine.sdk.common.CollectionDecorator.list(CollectionDecorator.java:154)
[STDOUT]        at org.ovirt.engine.sdk.decorators.Clusters.list(Clusters.java:75)
[STDOUT]        at org.ovirt.optimizer.service.ClusterDiscovery.getClusters(ClusterDiscovery.java:38)
[STDOUT]        at org.ovirt.optimizer.service.OptimizerServiceBean.discoveryTimeout(OptimizerServiceBean.java:75)
[STDOUT]        at org.ovirt.optimizer.service.OptimizerServiceBean$Proxy$_$$_WeldClientProxy.discoveryTimeout(Unknown Source)
[STDOUT]        at org.ovirt.optimizer.service.DiscoveryTimeout.execute(DiscoveryTimeout.java:18)
[STDOUT]        at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
[STDOUT]        ... 1 more


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

ovirt-engine-sdk-java git bd756ad09cd35bf256bd5be842b5ccbbb203d8c5
ovirt-engine git 4f111044f99ff5245934f5e5267f23d8f458042e

How reproducible:

Compile and start the ovirt-engine

- I have only the Default cluster there and two hosts

Regenerate the SDK using all the right commands in the proper dirs:

mvn verify -Pupdate-metadata
mvn verify -Pupdate-code

mvn clean install

Write a small program that tries to get a list of clusters.

Actual results:

NPE

Expected results:

List of clusters

Comment 1 Ondra Machacek 2014-09-03 14:30:36 UTC
for(Cluster cluster: api.getClusters().list())
        {
            System.out.println(cluster.getName());
        }

> Default

verified in ovirt-engine-sdk-java-3.5.0.3-0.1.el6.noarch

Comment 2 Sandro Bonazzola 2014-10-17 12:33:42 UTC
oVirt 3.5 has been released and should include the fix for this issue.