Bug 1013301 - RHEVM Backend: Bad request error doesn't returns enough details (cannot understand from the error what was bad/missing in request)
Summary: RHEVM Backend: Bad request error doesn't returns enough details (cannot under...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.3.0
Assignee: Eli Mesika
QA Contact: Ilia Meerovich
URL:
Whiteboard: infra
Depends On:
Blocks: 1019461 3.3snap2
TreeView+ depends on / blocked
 
Reported: 2013-09-29 07:42 UTC by Ilia Meerovich
Modified: 2016-02-10 19:17 UTC (History)
9 users (show)

Fixed In Version: is22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-21 22:16:40 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 19676 0 None None None Never
oVirt gerrit 20831 0 None None None Never

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


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