Bug 1005773 - NPE when attaching an existing iscsi storage connection to a storage domain
Summary: NPE when attaching an existing iscsi storage connection to a storage domain
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.3.0
Assignee: Daniel Erez
QA Contact: Elena
URL:
Whiteboard: storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-09 11:43 UTC by Katarzyna Jachim
Modified: 2016-02-10 20:12 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-23 13:19:29 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
engine.log + server.log (161.94 KB, application/x-compressed-tar)
2013-09-09 11:43 UTC, Katarzyna Jachim
no flags Details

Description Katarzyna Jachim 2013-09-09 11:43:20 UTC
Created attachment 795586 [details]
engine.log + server.log

Description of problem:
I have a storage domain and a storage connection. I try to attach the storage connection to the storage domain using following REST API call:

https://kj-rh33.rhev.lab.eng.brq.redhat.com/api/storagedomains/6c4915f7-dfcb-4f41-b43e-744c45ef8206

<storage_domain id="6c4915f7-dfcb-4f41-b43e-744c45ef8206">
    <storage id="b31edb88-2d62-4f21-85ca-5f36e917fa60"/>
</storage_domain>

It fails with null pointer exception in server.log:
2013-09-09 11:30:00,665 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/api].[org.ovirt.engine.api.restapi.BackendApplication]] (ajp-/127.0.0.1:8702-6) JBWEB000236: Servlet.service() for servlet org.ovirt.engine.api.restapi.BackendApplication threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
        at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:365) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
        at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:233) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
        at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:209) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
        at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:557) [resteasy-jaxrs.jar:2.3.6.Final-redhat-1]
...

I also tried following XML body:

<storage_domain id="6c4915f7-dfcb-4f41-b43e-744c45ef8206">
    <storage_connection id="b31edb88-2d62-4f21-85ca-5f36e917fa60"/>
</storage_domain>

the response was the same

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


How reproducible: 100%


Steps to Reproduce:
1. add an iscsi storage domain
2. add an iscsi connection
3. try to attach the connection to the storage domain

Actual results: 
action fails with null pointer exception in server.log

Expected results:
action should succeed

Additional info:

Comment 1 Daniel Erez 2013-09-23 12:42:13 UTC
Attaching a connection to a storage domain is done through storageconnections resource. I.e.:

POST /api/storagedomains/{storage_id}/storageconnections
  <storage_connection id="{connection_id}">
  </storage_connection>

Katarzyna, can you please try the described scenario again using this above api?


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