Bug 828351 - Backend: Unable to add bond through SetupNetworks via REST API. NullPointerException
Summary: Backend: Unable to add bond through SetupNetworks via REST API. NullPointerEx...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.1.0
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: ---
: ---
Assignee: Moti Asayag
QA Contact: Yaniv Kaul
URL:
Whiteboard: network
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-04 16:44 UTC by Avi Tal
Modified: 2016-04-22 04:59 UTC (History)
9 users (show)

Fixed In Version: si9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: Network
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
engine logs (151.64 KB, application/x-compressed-tar)
2012-06-04 16:44 UTC, Avi Tal
no flags Details

Description Avi Tal 2012-06-04 16:44:28 UTC
Created attachment 589208 [details]
engine logs

Unable to add bond through SetupNetworks via REST API. 
Command SetupNetworksVDS execution failed. Exception: NullPointerException

POST http://<rhevm>/api/hosts/<id>/nics/setupnetworks
<action>
 <host_nics>
  <host_nic>
   <name>eth1</name>
   <network>
    <name>sw1</name>
   </network>
   <boot_protocol>none</boot_protocol>
  </host_nic>
  <host_nic>
   <name>bond0</name>
   <network>
    <name>sw2</name>
   </network>
   <bonding>
    <options>
     <option name="mode" value="1"/>
    </options>
    <slaves>
     <host_nic>
      <name>eth2</name>
     </host_nic>
     <host_nic>
      <name>eth3</name>
     </host_nic>
    </slaves>
   </bonding>
  </host_nic>
  <host_nic>
   <name>eth0</name>
   <network>
    <name>rhevm</name>
   </network>
   <boot_protocol>dhcp</boot_protocol>
  </host_nic>
 </host_nics>
 <force>false</force>
 <checkConnectivity>true</checkConnectivity>
 <connectivityTimeout>60</connectivityTimeout>
</action>

RECEIVE 400
<fault>
            <reason>Operation Failed</reason>
            <detail>[]</detail>
    </fault>


Jboss Server NullPointerException
19:35:44,187 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp--0.0.0.0-8009-5) Operation Failed: []
19:35:44,188 WARN  [org.jboss.resteasy.core.SynchronousDispatcher] (ajp--0.0.0.0-8009-5) failed to execute: org.ovirt.engine.api.restapi.resource.BaseBackendResource$WebFaultException
        at org.ovirt.engine.api.restapi.resource.BaseBackendResource.handleError(BaseBackendResource.java:207) [restapi-jaxrs-3.1.0-0001.jar:]
        at org.ovirt.engine.api.restapi.resource.BackendResource.performAction(BackendResource.java:113) [restapi-jaxrs-3.1.0-0001.jar:]

Comment 3 Moti Asayag 2012-06-20 20:57:11 UTC
The described error isn't reproduced no more, it was fixed by commit d2787650655bbf4366a6eb6856ecdcb2b566a088.

However, same error happens ahead when running same scenario:

2012-06-20 17:49:58,061 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand] (http--0.0.0.0-8080-4) [2b7e51b2] START, SetupNetworksVDSCommand(vdsId = c92a01aa-9484-11e1-87b6-f334ad042300), log id: 7e81ab91
2012-06-20 17:52:22,388 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand] (http--0.0.0.0-8080-4) [2b7e51b2] Failed in SetupNetworksVDS method, for vds: venus-vdsb; host: 10.35.1.238
2012-06-20 17:52:22,392 ERROR [org.ovirt.engine.core.vdsbroker.VDSCommandBase] (http--0.0.0.0-8080-4) [2b7e51b2] Command SetupNetworksVDS execution failed. Exception: NullPointerException: 
2012-06-20 17:52:22,395 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand] (http--0.0.0.0-8080-4) [2b7e51b2] FINISH, SetupNetworksVDSCommand, log id: 7e81ab91
2012-06-20 17:52:22,396 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.BrokerCommandBase] (http--0.0.0.0-8080-4) [2b7e51b2] java.lang.NullPointerException
2012-06-20 17:52:22,399 ERROR [org.ovirt.engine.core.vdsbroker.VDSCommandBase] (http--0.0.0.0-8080-4) [2b7e51b2] Command SetupNetworksVDS execution failed. Exception: RuntimeException: java.lang.NullPointerException
2012-06-20 17:52:22,439 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (http--0.0.0.0-8080-4) [2b7e51b2] No string for UNASSIGNED type. Use default Log
2012-06-20 17:52:22,456 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (http--0.0.0.0-8080-4) Operation Failed: []

The cause of the error is not specifying bootprotocol for the bond interface.

A patch to handle it sent to:
http://gerrit.ovirt.org/#/c/5568/

Comment 4 Moti Asayag 2012-07-08 06:04:32 UTC
The commit id for the patch above: daf3eb6b4fd52bcb851399f0f082f2099605c352

Comment 5 Avi Tal 2012-07-12 10:59:56 UTC
verify on SI9 - PASS
I have tested the same scenario which caused the BZ and succeeded to create bond.

One small issue which probably worth BZ is that response SetupNetworks response contain code 200 but doesn't contain body with host_nics (after adding bond )


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