Bug 838329 - Gluster: wrong REST create request will cause to InternalServerErrorException exception
Summary: Gluster: wrong REST create request will cause to InternalServerErrorException...
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: rhsc
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
high
Target Milestone: ---
: ---
Assignee: Shubhendu Tripathi
QA Contact: Mike McCune
URL:
Whiteboard:
Depends On:
Blocks: 1035040
TreeView+ depends on / blocked
 
Reported: 2012-07-08 13:11 UTC by Ilia Meerovich
Modified: 2018-01-29 15:11 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
When incorrect create request is sent through REST api, an error message is displayed which contains the internal package structure.
Clone Of:
Environment:
Last Closed: 2018-01-29 15:11:14 UTC
Embargoed:


Attachments (Terms of Use)

Description Ilia Meerovich 2012-07-08 13:11:20 UTC
Description of problem:

Wrong REST create message (method is used with wrong collection)
causes to InternalServerErrorException in jboss

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


How reproducible:

easy and determenistic


Steps to Reproduce:
1.send:
CREATE request content is --  url:/api/clusters/a31e0108-c113-11e1-8ddc-3329202315f6/glustervolumes/3df61912-2180-475b-9998-890211d5ac92/bricks body:<brick>
    <brick>
        <server_id>a4d24748-c113-11e1-9500-d7cf041796b9</server_id>
        <brick_dir>/foo_1</brick_dir>
    </brick>
</brick>

  
Actual results:
14:24:09,617 WARN  [org.jboss.resteasy.core.SynchronousDispatcher] (ajp--0.0.0.0-8009-8) Failed executing POST /clusters/a31e0108-c113-11e1-8ddc-3329202315f6/glustervolumes/3df61912-2180-475b-9998-890211d5ac92/bricks: org.jboss.resteasy.
spi.InternalServerErrorException: Bad arguments passed to public abstract javax.ws.rs.core.Response org.ovirt.engine.api.resource.gluster.GlusterBricksResource.add(org.ovirt.engine.api.model.GlusterBricks)  ( org.ovirt.engine.api.model.G
lusterBrick org.ovirt.engine.api.model.GlusterBrick@ab06254 )
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:196) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:152) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:106) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:147) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:106) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:147) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:106) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:147) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec.jar:1.0.0.Final-redhat-1]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb.jar:]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb.jar:]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb.jar:]
        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web.jar:7.1.1.Final-redhat-1]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb.jar:]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb.jar:]
        at org.jboss.web.rewrite.RewriteValve.invoke(RewriteValve.java:466) [jbossweb.jar:]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb.jar:]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb.jar:]
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505) [jbossweb.jar:]
        at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445) [jbossweb.jar:]
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb.jar:]
        at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@a32c33f
        at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source) [:1.6.0_24]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
        at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs.jar:2.3.2.Final-redhat-1]


Expected results:
return meaningful error message

Additional info:

Comment 2 Shireesh 2012-07-09 04:15:28 UTC
Does this work fine for other existing REST apis? e.g. creation of a virtual machine.

Comment 3 Ilia Meerovich 2012-07-09 04:33:30 UTC
Actually I didn't tested it with other REST APIs.

Comment 4 Shireesh 2012-07-09 05:15:28 UTC
Can you please check and confirm? We need to identify whether this issue is specific to "Create Volume" or all POST requests in the system.

Comment 5 Ilia Meerovich 2012-07-09 06:49:00 UTC
Here is results of test with RHEVM (Thanks to Elena):

input:

Tool:Firefox Add-on Poster
Request:
URL:https://aqua-rhel.qa.lab.tlv.redhat.com/api/datacenters
Content-type:application/xml
Body:
<data_centers>
    <name>DefaultRest1</name>
    <storage_type>nfs</storage_type>
    <version major="3" minor="1"/>
</data_centers>

result (no error in jboss):

<html><head><title>JBoss Web/7.0.13..Final-redhat-1 - 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 - Bad arguments passed to public abstract javax.ws.rs.core.Response org.ovirt.engine.api.resource.DataCentersResource.add(org.ovirt.engine.api.model.DataCenter)  ( org.ovirt.engine.api.model.DataCenters org.ovirt.engine.api.model.DataCenters@587ad11b )</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Bad arguments passed to public abstract javax.ws.rs.core.Response org.ovirt.engine.api.resource.DataCentersResource.add(org.ovirt.engine.api.model.DataCenter)  ( org.ovirt.engine.api.model.DataCenters org.ovirt.engine.api.model.DataCenters@587ad11b )</u></p><p><b>description</b> <u>The server encountered an internal error (Bad arguments passed to public abstract javax.ws.rs.core.Response org.ovirt.engine.api.resource.DataCentersResource.add(org.ovirt.engine.api.model.DataCenter)  ( org.ovirt.engine.api.model.DataCenters org.ovirt.engine.api.model.DataCenters@587ad11b )) that prevented it from fulfilling this request.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.0.13..Final-redhat-1</h3></body></html>

Comment 6 Shireesh 2012-07-09 06:58:41 UTC
Is this similar to what you got in case of Gluster Volume? (Asking because you have not provided the response body but log extract in the original bug description)

Also, did we get the same exception (InternalServerErrorException) in the logs in RHEVM?

Comment 7 Ilia Meerovich 2012-07-09 07:15:31 UTC
the difference is that in gluster jbossas log shows exception and it is not handled.
In Rhevm it was error 500 was returned without any exception traces in jbosas log.

Comment 8 Kanagaraj 2013-04-12 11:56:18 UTC
The log message looks identical when a wrong request is sent to 
https://hostname/api/datacenters and
https://hostname/api/clusters/a31e0108-c113-11e1-8ddc-3329202315f6/glustervolumes/3df61912-2180-475b-9998-890211d5ac92/bricks .

500 error is returned in both the cases and an exception(InternalServerErrorException) is thrown in the jboss log.

we can close this bug if this behavior is fine.

Comment 9 Dustin Tsang 2013-06-07 04:01:08 UTC
confirmed that 500 Error and log is logged to /var/log/ovirt-engine/server.log(jboss log) as expected in rhsc-bb2.

However the application still exposes the guts of the application to the client. Although this is currently consistent with all of the other rest calls, the client should not expose any of its internals to the client.

Also the error message provided seems like it should be more of a 4xx type http status. 

For example this is the response from the invalid request:

JBWEB000065: HTTP Status 500 - Bad arguments passed to public abstract javax.ws.rs.core.Response org.ovirt.engine.api.resource.gluster.GlusterBricksResource.add(org.ovirt.engine.api.model.GlusterBricks)  ( org.ovirt.engine.api.model.GlusterBrick org.ovirt.engine.api.model.GlusterBrick@4e7734a9 )

Comment 10 Shalaka 2014-01-29 06:21:09 UTC
Please review the edited Doc Text and sign off.

Comment 11 Shubhendu Tripathi 2014-01-29 06:35:23 UTC
doc text looks fine

Comment 17 Sahina Bose 2018-01-29 15:11:14 UTC
Thank you for your report. This bug is filed against a component for which no further new development is being undertaken


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