Bug 1013301

Summary: RHEVM Backend: Bad request error doesn't returns enough details (cannot understand from the error what was bad/missing in request)
Product: Red Hat Enterprise Virtualization Manager Reporter: Ilia Meerovich <iliam>
Component: ovirt-engineAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Ilia Meerovich <iliam>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, bazulay, iheim, lpeer, oramraz, pstehlik, Rhev-m-bugs, srevivo, yeylon
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: is22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 22:16:40 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: 1019461, 1032811    

Description Ilia Meerovich 2013-09-29 07:42:08 UTC
import org.ovirt.engine.sdk.Api;
import org.ovirt.engine.sdk.decorators.Host;
import org.ovirt.engine.sdk.entities.PowerManagement;


public class debugRemove {
        private static final String URL = "https://ilia-rhevm.qa.lab.tlv.redhat.com:443/api";

    public static void main(String[] args) throws Exception {
        Api api = new Api(URL, "admin@internal", "123456", true);
        Host hst = (Host) api.getHosts().list().get(0);
        PowerManagement pm = new PowerManagement();
        pm.setType("apc");
        Boolean bl = new Boolean("true");
        pm.setEnabled(bl);
        hst.setPowerManagement(pm);
        hst.update();
        api.close();
    }
}

raises next exception:
Exception in thread "main" 
code  : 400
reason: Bad Request
detail: may not be null
	at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:118)
	at org.ovirt.engine.sdk.web.HttpProxyBroker.update(HttpProxyBroker.java:104)
	at org.ovirt.engine.sdk.decorators.Host.update(Host.java:390)
	at debugRemove.main(debugRemove.java:17)

Comment 1 Ilia Meerovich 2013-11-17 15:58:59 UTC
verified with is23, now getting meaningful message:

Exception in thread "main" 
code  : 400
reason: Bad Request
detail: Cannot edit Host. Power Management is enabled for Host but Agent credentials are missing.
	at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:118)
	at org.ovirt.engine.sdk.web.HttpProxyBroker.update(HttpProxyBroker.java:104)
	at org.ovirt.engine.sdk.decorators.Host.update(Host.java:398)
	at java_sdk_testing.JavaSDKTestDebug.main(JavaSDKTestDebug.java:19)

Comment 2 Itamar Heim 2014-01-21 22:16:40 UTC
Closing - RHEV 3.3 Released

Comment 3 Itamar Heim 2014-01-21 22:23:24 UTC
Closing - RHEV 3.3 Released