[ 
https://issues.apache.org/jira/browse/SQOOP-2687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15005957#comment-15005957
 ] 

Jonathan Seidman commented on SQOOP-2687:
-----------------------------------------

Thanks [~jarcec]. I missed 2684. 

My assumption is that the code that gets the job details just needs to be 
updated to use link name instead of ID.

sqoop:000> show 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:69)  
         at  org.apache.sqoop.client.request.ResourceRequest 
(ResourceRequest.java:179)  
         at  org.apache.sqoop.client.request.LinkResourceRequest 
(LinkResourceRequest.java:53)  
         at  org.apache.sqoop.client.request.SqoopResourceRequests 
(SqoopResourceRequests.java:126)  
         at  org.apache.sqoop.client.SqoopClient (SqoopClient.java:311)  
         at  org.apache.sqoop.shell.ShowJobFunction (ShowJobFunction.java:98)  
         at  org.apache.sqoop.shell.ShowJobFunction (ShowJobFunction.java:71)  
         at  org.apache.sqoop.shell.SqoopFunction (SqoopFunction.java:51)  
         at  org.apache.sqoop.shell.SqoopCommand (SqoopCommand.java:135)  
         at  org.apache.sqoop.shell.SqoopCommand (SqoopCommand.java:111)  
         at  org.codehaus.groovy.tools.shell.Command$execute (null:-1)  
         at  org.codehaus.groovy.runtime.callsite.CallSiteArray 
(CallSiteArray.java:42)  
         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:233)  
         at  groovy.lang.MetaClassImpl (MetaClassImpl.java:1054)  
         at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
(ScriptBytecodeAdapter.java:128)  
         at  org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:173)  
         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:267)  
         at  org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite 
(PogoMetaMethodSite.java:52)  
         at  org.codehaus.groovy.runtime.callsite.AbstractCallSite 
(AbstractCallSite.java:141)  
         at  org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:121)  
         at  org.codehaus.groovy.tools.shell.Shell (Shell.groovy:114)  
         at  org.codehaus.groovy.tools.shell.Shell$leftShift$0 (null:-1)  
         at  org.codehaus.groovy.tools.shell.ShellRunner 
(ShellRunner.groovy:88)  
         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:233)  
         at  groovy.lang.MetaClassImpl (MetaClassImpl.java:1054)  
         at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
(ScriptBytecodeAdapter.java:128)  
         at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
(ScriptBytecodeAdapter.java:148)  
         at  org.codehaus.groovy.tools.shell.InteractiveShellRunner 
(InteractiveShellRunner.groovy:100)  
         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:267)  
         at  org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite 
(PogoMetaMethodSite.java:52)  
         at  org.codehaus.groovy.runtime.callsite.AbstractCallSite 
(AbstractCallSite.java:137)  
         at  org.codehaus.groovy.tools.shell.ShellRunner 
(ShellRunner.groovy:57)  
         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:233)  
         at  groovy.lang.MetaClassImpl (MetaClassImpl.java:1054)  
         at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
(ScriptBytecodeAdapter.java:128)  
         at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
(ScriptBytecodeAdapter.java:148)  
         at  org.codehaus.groovy.tools.shell.InteractiveShellRunner 
(InteractiveShellRunner.groovy:66)  
         at  java_lang_Runnable$run (null:-1)  
         at  org.codehaus.groovy.runtime.callsite.CallSiteArray 
(CallSiteArray.java:42)  
         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:463)  
         at  org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:402)  
         at  org.apache.sqoop.shell.SqoopShell (SqoopShell.java:128)  
Caused by: Exception: java.lang.Throwable Message: Invalid link name: 1 doesn't 
exist
Stack trace:
         at  org.apache.sqoop.handler.HandlerUtils (HandlerUtils.java:44)  
         at  org.apache.sqoop.handler.LinkRequestHandler 
(LinkRequestHandler.java:216)  
         at  org.apache.sqoop.handler.LinkRequestHandler 
(LinkRequestHandler.java:67)  
         at  org.apache.sqoop.server.v1.LinkServlet (LinkServlet.java:72)  
         at  org.apache.sqoop.server.SqoopProtocolServlet 
(SqoopProtocolServlet.java:50)  
         at  javax.servlet.http.HttpServlet (HttpServlet.java:687)  
         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:572)  
         at  
org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticationFilter
 (DelegationTokenAuthenticationFilter.java:269)  
         at  
org.apache.hadoop.security.authentication.server.AuthenticationFilter 
(AuthenticationFilter.java:542)  
         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)  



> SQOOP2: Recent interface changes appear to have broken shell functionality
> --------------------------------------------------------------------------
>
>                 Key: SQOOP-2687
>                 URL: https://issues.apache.org/jira/browse/SQOOP-2687
>             Project: Sqoop
>          Issue Type: Bug
>          Components: sqoop2-shell
>    Affects Versions: 1.99.7
>            Reporter: Jonathan Seidman
>
> Recent interface changes (e.g. SQOOP-2674 and 2675) seem to have broken some 
> shell functionality. For example:
> sqoop:000> create link -c hdfs-connector
> Creating link for connector with id hdfs-connector
> Please fill following values to create new link object
> Name: My HDFS Link
> sqoop:000> create link -c generic-jdbc-connector
> Creating link for connector with id generic-jdbc-connector
> Please fill following values to create new link object
> Name: My DB Link
> sqoop:000> show link
> {noformat}
> +----+--------------+--------------+------------------------+---------+
> | Id |     Name     | Connector Id |     Connector Name     | Enabled |
> +----+--------------+--------------+------------------------+---------+
> | 1  | My HDFS Link | 6            | hdfs-connector         | true    |
> | 2  | My DB Link   | 7            | generic-jdbc-connector | true    |
> +----+--------------+--------------+------------------------+---------+
> {noformat}
> sqoop:000> create job -f 1 -t 2          
> Creating job for links with from id 1 and to id 2
> Exception has occurred during processing command 
> Exception: org.apache.sqoop.common.SqoopException Message: CLIENT_0001:Server 
> has returned exception
> (org.apache.sqoop.common.SqoopException: SERVER_0006:Entity requested doesn't 
> exist - Invalid link name: 1 doesn't exist)
> This seems as expected, so:
> sqoop:000> create job -f My HDFS Link -t My DB Link   
> Invalid command invocation: Missing required option: t
> Assuming that the Options library parses out first word, then maybe:
> sqoop:000> create job -f "My HDFS Link" -t "My DB Link"
> Exception has occurred during processing command 
> Exception: org.codehaus.groovy.control.MultipleCompilationErrorsException 
> Message: startup failed:
> Script3.groovy: 1: unexpected char: '"' @ line 1, column 5.
>    ""My"
>        ^
> 1 error
> Nope, so...
> sqoop:000> create link -c hdfs-connector               
> Creating link for connector with id hdfs-connector
> Please fill following values to create new link object
> Name: hdfs-link
> ...
> New link was successfully created with validation status OK and persistent id 
> 3
> sqoop:000> create link -c generic-jdbc-connector
> Creating link for connector with id generic-jdbc-connector
> Please fill following values to create new link object
> Name: db-link
> ...
> New link was successfully created with validation status OK and persistent id 
> 4
> This looks good, but...
> sqoop:000> create job -f hdfs-link -t db-link
> Creating job for links with from id hdfs-link and to id db-link
> Please fill following values to create new job object
> Name: my first job
> ...
> New job was successfully created with validation status OK  and persistent id 
> 1
> sqoop:000> show job
> Exception has occurred during processing command 
> Exception: org.apache.sqoop.common.SqoopException Message: CLIENT_0001:Server 
> has returned exception
> (org.apache.sqoop.common.SqoopException: SERVER_0006:Entity requested doesn't 
> exist - Invalid link name: 3 doesn't exist)
> and so on...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to