Bug 1053062 - Failed to create data center with default version
Summary: Failed to create data center with default version
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.4.1
Assignee: Eli Mesika
QA Contact: bugs@ovirt.org
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-14 16:08 UTC by Ilia Meerovich
Modified: 2016-07-05 00:06 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-08 13:35:12 UTC
oVirt Team: ---


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 26145 0 None MERGED core:Failed to create data center with default version Never
oVirt gerrit 26495 0 ovirt-engine-3.4 MERGED core:Failed to create data center with default version Never

Description Ilia Meerovich 2014-01-14 16:08:21 UTC
Hi, I expected to get:
- Error message that version should be set or
- Datacenter will be created with default version.
actual result:

code:

import org.ovirt.engine.sdk.Api;
import org.ovirt.engine.sdk.entities.DataCenter;

public class JavaSDKTestDebug {
	private static final String URL = "https://ilia-rhevm.qa.lab.tlv.redhat.com:443/api";
	private static final Boolean debug = false; 
	private static final Boolean noHostVerifictaion = true;

	public static void main(String[] args) throws Exception {
		Api api = new Api(URL, "vdcadmin@qa.lab.tlv.redhat.com", "******", null, null, null, null, noHostVerifictaion, null, debug);
		DataCenter dc = new DataCenter();
		dc.setName("foo");
		dc.setStorageType("nfs");
		api.getDataCenters().add(dc);
		//api.getDataCenters().get("foo").delete();
		api.shutdown();
	}
}

Result:

code  : 400
reason: Bad Request
detail: Cannot create Data Center. Selected Compatibility Version is not supported.
	at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:118)
	at org.ovirt.engine.sdk.web.HttpProxyBroker.add(HttpProxyBroker.java:209)
	at org.ovirt.engine.sdk.decorators.DataCenters.add(DataCenters.java:178)
	at java_sdk_testing.JavaSDKTestDebug.main(JavaSDKTestDebug.java:75)

rpm versions:
[root@ilia-rhevm ~]# rpm -q ovirt-engine
ovirt-engine-3.4.0-0.2.master.20140106180914.el6.noarch
[root@ilia-rhevm ~]# 
[root@imeerovi ~]# rpm -q ovirt-engine-sdk-java
ovirt-engine-sdk-java-3.4.0.1-1.el6.noarch

Comment 1 Juan Hernández 2014-01-14 17:31:36 UTC
The SDK is posting the following to the RESTAPI /datacenters collection:

  <data_center>
  <name>foo</name>
  <storage_type>nfs</storage_type>
  </data_center>

I checked that in this case the RESTAPI is passing to the backend "null" in the compatibility version field of the data center object. So I think that the bug is in the backend: it should assign a default when the value given is "null".

Comment 2 Juan Hernández 2014-01-14 17:33:08 UTC
Eli, can you take a look and confirm/reject that the bug is in the backend?

Comment 3 Ilia Meerovich 2014-01-14 18:13:31 UTC
ovirt & jbossas logs:

[root@ilia-rhevm ~]# tailf /var/log/ovirt-engine/engine.log

2014-01-14 20:11::11:38,22155 ERROR [[org.oviirt.et.enginee.ccoree.bbll.adbbrooker.DirectorySearcher] (ajp--127.0.0.1.1-87022-6)6) EError in fiinding  LDAP servers for ddomain  dc.eng.lab.tllv.redhat.com uusing usng user  vddcadmin@@QA..LAB..TLV.REEDHAT.COM
2014-01-14 20:11:38,279 INFO  [org.ovirt.engine.core.bll.LoginUserCommand] (ajp--127.0.0.1-8702-6) Running command: LoginUserCommand internal: false.
2014-01-14 20:11:38,285 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (ajp--127.0.0.1-8702-6) Correlation ID: null, Call Stack: null, Custom Event ID: -1, Message: User vdcadmin logged in.
2014-01-14 20:11:39,754 WARN  [org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand] (ajp--127.0.0.1-8702-8) [56070bcd] CanDoAction of action AddEmptyStoragePool failed. Reasons:VAR__TYPE__STORAGE__POOL,VAR__ACTION__CREATE,ACTION_TYPE_FAILED_GIVEN_VERSION_NOT_SUPPORTED
2014-01-14 20:11:39,760 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp--127.0.0.1-8702-8) Operation Failed: [Cannot create Data Center. Selected Compatibility Version is not supported.]

[root@ilia-rhevm ~]# tailf /var/log/ovirt-engine/server.log

2014-01-14 20:12:49,918 WARN  [org.jboss.resteasy.core.SynchronousDispatcher] (ajp--127.0.0.1-8702-5) failed to execute: org.ovirt.engine.api.restapi.resource.BaseBackendResource$WebFaultException
	at org.ovirt.engine.api.restapi.resource.BaseBackendResource.handleError(BaseBackendResource.java:233) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.BaseBackendResource.handleError(BaseBackendResource.java:208) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.doCreateEntity(AbstractBackendCollectionResource.java:248) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.performCreate(AbstractBackendCollectionResource.java:119) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.performCreate(AbstractBackendCollectionResource.java:109) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.performCreate(AbstractBackendCollectionResource.java:128) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.BackendDataCentersResource.add(BackendDataCentersResource.java:55) [restapi-jaxrs.jar:]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
	at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
	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.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]
	at org.jboss.reesteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [[jbossweb-7.0.13.Final.jar:]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]
	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
	at org.jboss.web.rewrite.RewriteValve.invoke(RewriteValve.java:466) [jbossweb-7.0.13.Final.jar:]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
	at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505) [jbossweb-7.0.13.Final.jar:]
	at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445) [jbossweb-7.0.13.Final.jar:]
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]

Comment 4 Eli Mesika 2014-01-15 09:10:02 UTC
Yes, as you can see in the log, it fails in the engine on the canDoAction.
Assigning the bug to infra

Comment 5 Sandro Bonazzola 2014-03-04 09:17:02 UTC
This is an automated message.
Re-targeting all non-blocker bugs still open on 3.4.0 to 3.4.1.

Comment 6 Sandro Bonazzola 2014-05-08 13:35:12 UTC
This is an automated message

oVirt 3.4.1 has been released:
 * should fix your issue
 * should be available at your local mirror within two days.

If problems still persist, please make note of it in this bug report.


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