Bug 1119862 - NPE when trying to allocate VM from pool
Summary: NPE when trying to allocate VM from pool
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-api
Version: 3.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.0
Assignee: Juan Hernández
QA Contact: Ilanit Stein
URL:
Whiteboard: virt
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-15 17:03 UTC by Juan Hernández
Modified: 2016-02-10 19:48 UTC (History)
5 users (show)

Fixed In Version: ovirt-3.5.0-beta2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-17 12:21:13 UTC
oVirt Team: Virt


Attachments (Terms of Use)
verification engine.log (7.82 KB, text/x-log)
2014-07-30 08:38 UTC, Ilanit Stein
no flags Details


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 30120 master MERGED restapi: Fix access to current user Never
oVirt gerrit 30252 ovirt-engine-3.5 MERGED restapi: Fix access to current user Never

Description Juan Hernández 2014-07-15 17:03:22 UTC
Trying to allocate a VM from a pool produces a NPE:

Caused by: java.lang.NullPointerException
        at org.ovirt.engine.core.common.action.VmPoolUserParameters.<init>(VmPoolUserParameters.java:12)
        at org.ovirt.engine.api.restapi.resource.BackendVmPoolResource.allocatevm(BackendVmPoolResource.java:143) [restapi-jaxrs.jar:]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_55]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_55]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_55]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_55]
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:152) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]

Easy to reproduce with the following script:

#!/bin/sh -x

url="https://fedora.example.com/ovirt-engine/api"
user="admin@internal"
password="******"

curl \
--insecure \
--request POST \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
--user "${user}:${password}" \
--data "
<action/>
" \
${url}/vmpools/<vmpool_id>/allocatevm

Comment 1 Ilanit Stein 2014-07-30 08:37:33 UTC
Verified on ovirt-engine-3.5.0-0.0.master.20140722232058.git8e1babc.el6.noarch.

Run the script in the description.
got these events:
014-Jul-30, 11:26
Attaching User admin to VM POOL-1 in VM Pool POOL was initiated by admin.
	
2014-Jul-30, 11:26
VM POOL-1 was restarted on Host Non interactive user

engine.log attached. no NPE.

Comment 2 Ilanit Stein 2014-07-30 08:38:17 UTC
Created attachment 922459 [details]
verification engine.log

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


Note You need to log in before you can comment on or make changes to this bug.