Jarek Jarcec Cecho created SQOOP-2765:
-----------------------------------------
Summary: Sqoop2: Client is not exposing the real exception when
retrieving exception from server
Key: SQOOP-2765
URL: https://issues.apache.org/jira/browse/SQOOP-2765
Project: Sqoop
Issue Type: Bug
Affects Versions: 1.99.7
Reporter: Jarek Jarcec Cecho
Fix For: 1.99.7
When there is exception on the server side, we display useless output, for
example:
{code}
sqoop:000> start job --name non-existing-job
Exception has occurred during processing command
Exception: org.apache.sqoop.common.SqoopException Message: CLIENT_0001:Server
has returned exception
sqoop:000>
{code}
One have to enable verbose mode and dig the real exception from the stack trace:
{code}
sqoop:000> set option --name verbose --value true
Verbose option was changed to true
sqoop:000> start job --name non-existing-job
Exception has occurred during processing command
Exception: org.apache.sqoop.common.SqoopException Message: CLIENT_0001:Server
has returned exception
Stack trace:
at org.apache.sqoop.client.request.ResourceRequest
(ResourceRequest.java:137)
at org.apache.sqoop.client.request.ResourceRequest
(ResourceRequest.java:187)
at org.apache.sqoop.client.request.JobResourceRequest
(JobResourceRequest.java:113)
at org.apache.sqoop.client.request.SqoopResourceRequests
(SqoopResourceRequests.java:170)
at org.apache.sqoop.client.SqoopClient (SqoopClient.java:453)
at org.apache.sqoop.shell.StartJobFunction (StartJobFunction.java:64)
at org.apache.sqoop.shell.SqoopFunction (SqoopFunction.java:51)
at org.apache.sqoop.shell.SqoopCommand (SqoopCommand.java:134)
at org.apache.sqoop.shell.SqoopCommand (SqoopCommand.java:110)
at org.codehaus.groovy.tools.shell.Command$execute (null:-1)
at org.codehaus.groovy.runtime.callsite.CallSiteArray
(CallSiteArray.java:45)
at org.codehaus.groovy.tools.shell.Command$execute (null:-1)
at org.codehaus.groovy.tools.shell.Shell (Shell.groovy:101)
at org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:-1)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:-2)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method (Method.java:606)
at org.codehaus.groovy.reflection.CachedMethod (CachedMethod.java:90)
at groovy.lang.MetaMethod (MetaMethod.java:324)
at groovy.lang.MetaClassImpl (MetaClassImpl.java:1208)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter
(ScriptBytecodeAdapter.java:130)
at org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:254)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:-2)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method (Method.java:606)
at
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce
(PogoMetaMethodSite.java:207)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite
(PogoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite
(AbstractCallSite.java:161)
at org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:153)
at org.codehaus.groovy.tools.shell.Shell (Shell.groovy:119)
at org.codehaus.groovy.tools.shell.Shell$leftShift$0 (null:-1)
at org.codehaus.groovy.tools.shell.ShellRunner (ShellRunner.groovy:94)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner
(InteractiveShellRunner.groovy:-1)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:-2)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method (Method.java:606)
at org.codehaus.groovy.reflection.CachedMethod (CachedMethod.java:90)
at groovy.lang.MetaMethod (MetaMethod.java:324)
at groovy.lang.MetaClassImpl (MetaClassImpl.java:1208)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter
(ScriptBytecodeAdapter.java:130)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter
(ScriptBytecodeAdapter.java:150)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner
(InteractiveShellRunner.groovy:123)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:-2)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method (Method.java:606)
at
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce
(PogoMetaMethodSite.java:207)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite
(PogoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite
(AbstractCallSite.java:153)
at org.codehaus.groovy.tools.shell.ShellRunner (ShellRunner.groovy:58)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner
(InteractiveShellRunner.groovy:-1)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:-2)
at sun.reflect.NativeMethodAccessorImpl
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method (Method.java:606)
at org.codehaus.groovy.reflection.CachedMethod (CachedMethod.java:90)
at groovy.lang.MetaMethod (MetaMethod.java:324)
at groovy.lang.MetaClassImpl (MetaClassImpl.java:1208)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter
(ScriptBytecodeAdapter.java:130)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter
(ScriptBytecodeAdapter.java:150)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner
(InteractiveShellRunner.groovy:82)
at java_lang_Runnable$run (null:-1)
at org.codehaus.groovy.runtime.callsite.CallSiteArray
(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite
(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite
(AbstractCallSite.java:112)
at org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:585)
at org.apache.sqoop.shell.SqoopShell (SqoopShell.java:128)
Caused by: Exception: java.lang.Throwable Message: Job: non-existing-job
doesn't exist
Stack trace:
at org.apache.sqoop.handler.HandlerUtils (HandlerUtils.java:34)
at org.apache.sqoop.handler.JobRequestHandler
(JobRequestHandler.java:359)
at org.apache.sqoop.handler.JobRequestHandler
(JobRequestHandler.java:112)
at org.apache.sqoop.server.v1.JobServlet (JobServlet.java:84)
at org.apache.sqoop.server.SqoopProtocolServlet
(SqoopProtocolServlet.java:81)
at javax.servlet.http.HttpServlet (HttpServlet.java:710)
at javax.servlet.http.HttpServlet (HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder (ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain
(ServletHandler.java:1669)
at
org.apache.hadoop.security.authentication.server.AuthenticationFilter
(AuthenticationFilter.java:589)
at
org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticationFilter
(DelegationTokenAuthenticationFilter.java:291)
at
org.apache.hadoop.security.authentication.server.AuthenticationFilter
(AuthenticationFilter.java:552)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain
(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler (ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ContextHandler
(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler (ServletHandler.java:515)
at org.eclipse.jetty.server.handler.ContextHandler
(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler
(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper
(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server (Server.java:499)
at org.eclipse.jetty.server.HttpChannel (HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection (HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2
(AbstractConnection.java:540)
at java.util.concurrent.ThreadPoolExecutor
(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker
(ThreadPoolExecutor.java:615)
at java.lang.Thread (Thread.java:745)
sqoop:000>
{code}
It would be great to display the original exception description without the
verbose mode.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)