Bug 787672 - HTTP 500 when adding a cluster
Summary: HTTP 500 when adding a cluster
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-api
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Michael Pasternak
QA Contact:
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-06 13:35 UTC by Jaroslav Henner
Modified: 2014-01-13 00:36 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-12 08:31:08 UTC
oVirt Team: ---


Attachments (Terms of Use)

Description Jaroslav Henner 2012-02-06 13:35:08 UTC
Description of problem:
When adding a cluster with existing name using ovirt-engine-sdk, I found that it is sending the following which causes HTTP 500. I have no idea why headers are empty, but I reproduced it also manually with Content-Type set.


2012-02-06 14:17:41,073 - MainThread - ovirtsdk_backendovirtsdk_backend - DEBUG - http request, conn: <ovirtsdk.web.connection.Connection object at 0x261da50>
2012-02-06 14:17:41,073 - MainThread - ovirtsdk_backendovirtsdk_backend - DEBUG - method: POST url: /api/clusters
2012-02-06 14:17:41,073 - MainThread - ovirtsdk_backendovirtsdk_backend - DEBUG - headers: {}
2012-02-06 14:17:41,073 - MainThread - ovirtsdk_backendovirtsdk_backend - DEBUG - body:
<cluster>
    <name>RestCluster1</name>
    <cpu id="Intel Conroe Family"/>
    <data_center>
        <name>DefaultRest</name>
    </data_center>
    <version/>
    <error_handling/>
</cluster>

---
2012-02-06 14:17:41,298 - MainThread - root - INFO - Caugh RequestError: <class 'ovirtsdk.infrastructure.errors.RequestError'>:

status: 500
reason: Internal Server Error
detail: <html><head><title>JBoss Web/2.1.12.GA-patch-01 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
	org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345)
	org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321)
	org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214)
	org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190)
	org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
	org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>root cause</b> <pre>java.lang.NullPointerException
	org.ovirt.engine.core.common.action.VdsGroupOperationParameters.&lt;init&gt;(VdsGroupOperationParameters.java:20)
	org.ovirt.engine.api.restapi.resource.BackendClustersResource.add(BackendClustersResource.java:48)
	sun.reflect.GeneratedMethodAccessor1310.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
	org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255)
	org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220)
	org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209)
	org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)
	org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
	org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the JBoss Web/2.1.12.GA-patch-01 logs.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.12.GA-patch-01</h3></body></html>


Version-Release number of selected component (if applicable):
ic154.1

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:
Cluster not added, but something else than HTTP 500

Additional info:

Comment 1 Jaroslav Henner 2012-02-06 13:36:08 UTC
There's nothing in the rhevm.log.

Comment 2 Jaroslav Henner 2012-02-06 13:43:09 UTC
It happens only when there is a DC with name referred in the POST request. If there is no such DC, I'm getting:

2012-02-06 14:41:36,387 - MainThread - root - INFO - Caugh RequestError: <class 'ovirtsdk.infrastructure.errors.RequestError'>:

status: 400
reason: Bad Request
detail: Entity not found: Datacenter: name=DefaultRest

Which Is what I would expect.

Comment 3 Ori Liel 2012-07-12 08:31:08 UTC
The bug description was not entirely clear to me. So I talked to jhenner, and he refined it for me. The issue is: 

"When creating a cluster, if the data-center is identified by name (a valid name; meaning, a data-center with this name exists) - the operation fails with internal server error."

I've tried to reproduce this by posting: 

<cluster>
  <data_center>
    <name>dc1</name>
  </data_center>
  <name>cluster_test_ori</name>
  <version minor="0" major="3"/>
  <cpu id="Intel Conroe Family"/>
</cluster>

And the creation succeeded. 

I am closing the bug with "works_for_me" status.


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