[jira] [Commented] (OOZIE-2576) Oozie ssh action Cannot run program "scp"
[ https://issues.apache.org/jira/browse/OOZIE-2576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16936818#comment-16936818 ] Mate Juhasz commented on OOZIE-2576: Its a bit late to answer, but I think the error is because adding multiple commands are not supported in case of ssh actions. It should work if you specify the command like below: {noformat} /tmp/test.sh {noformat} Or: {noformat} sh /tmp/test.sh {noformat} > Oozie ssh action Cannot run program "scp" > - > > Key: OOZIE-2576 > URL: https://issues.apache.org/jira/browse/OOZIE-2576 > Project: Oozie > Issue Type: Bug > Components: action >Affects Versions: 4.0.0 > Environment: Oozie server build version: 4.0.0-cdh5.2.0 >Reporter: ywheel >Priority: Blocker > > We used oozie ssh action in a production environment, the following xml codes > is the example: > {noformat} > > > > > root@192.168.1.154 > sh /tmp/test.sh > > > > > > > Action failed, error > message[${wf:errorMessage(wf:lastErrorNode())}] > > > > {noformat} > However, we meet the errors below: > {noformat} > 2016-06-12 22:30:54,713 INFO org.apache.oozie.action.ssh.SshActionExecutor: > SERVER[Master] USER[hdfs] GROUP[-] TOKEN[] APP[TestSsh] > JOB[201-160113124428061-oozie-oozi-W] > ACTION[201-160113124428061-oozie-oozi-W@ShellAction] Attempting to copy > ssh base scripts to remote host [root@192.168.1.154] > 2016-06-12 22:30:54,869 WARN org.apache.oozie.action.ssh.SshActionExecutor: > SERVER[Master] USER[hdfs] GROUP[-] TOKEN[] APP[TestSsh] > JOB[201-160113124428061-oozie-oozi-W] > ACTION[201-160113124428061-oozie-oozi-W@ShellAction] Error while > executing ssh EXECUTION > 2016-06-12 22:30:54,870 WARN org.apache.oozie.command.wf.ActionStartXCommand: > SERVER[Master] USER[hdfs] GROUP[-] TOKEN[] APP[TestSsh] > JOB[201-160113124428061-oozie-oozi-W] > ACTION[201-160113124428061-oozie-oozi-W@ShellAction] Error starting > action [ShellAction]. ErrorType [ERROR], ErrorCode [UNKOWN_ERROR], Message > [UNKOWN_ERROR: Cannot run program "scp": error=2, No such file or directory] > org.apache.oozie.action.ActionExecutorException: UNKOWN_ERROR: Cannot run > program "scp": error=2, No such file or directory > at > org.apache.oozie.action.ssh.SshActionExecutor.execute(SshActionExecutor.java:599) > at > org.apache.oozie.action.ssh.SshActionExecutor.start(SshActionExecutor.java:204) > at > org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:228) > at > org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:63) > at org.apache.oozie.command.XCommand.call(XCommand.java:281) > at > org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:323) > at > org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:252) > at > org.apache.oozie.service.CallableQueueService$CallableWrapper.run(CallableQueueService.java:174) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:744) > Caused by: java.io.IOException: Cannot run program "scp": error=2, No such > file or directory > at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) > at java.lang.Runtime.exec(Runtime.java:617) > at java.lang.Runtime.exec(Runtime.java:485) > at > org.apache.oozie.action.ssh.SshActionExecutor.executeCommand(SshActionExecutor.java:332) > at > org.apache.oozie.action.ssh.SshActionExecutor.setupRemote(SshActionExecutor.java:376) > at > org.apache.oozie.action.ssh.SshActionExecutor$1.call(SshActionExecutor.java:206) > at > org.apache.oozie.action.ssh.SshActionExecutor$1.call(SshActionExecutor.java:204) > at > org.apache.oozie.action.ssh.SshActionExecutor.execute(SshActionExecutor.java:548) > ... 10 more > Caused by: java.io.IOException: error=2, No such file or directory > at java.lang.UNIXProcess.forkAndExec(Native Method) > at java.lang.UNIXProcess.(UNIXProcess.java:135) > at java.lang.ProcessImpl.start(ProcessImpl.java:130) > at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) > ... 17 more > {noformat} > I checked the codes in {{org.apache.oozie.action.ssh.SshActionExecutor}} > class, and I found oozie would execute 'scp' command to copy two > files(ssh-base.sh,ssh-wrapper.sh) to the workspace folder on remote host. But > the logs could not show any information about which file is not found. > The workspace folder on remote host was created so the 'ssh'
[jira] [Commented] (OOZIE-2576) Oozie ssh action Cannot run program "scp"
[ https://issues.apache.org/jira/browse/OOZIE-2576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15333797#comment-15333797 ] ywheel commented on OOZIE-2576: --- The exception should be thrown by `executeCommand` for SCP command, you can find it in line 376 in SshActionExecutor {noformat} command = XLog.format("{0}{1}/ssh-base.sh {2}/ssh-wrapper.sh {3}:{4}", SCP_COMMAND_BASE, localDirLocation, localDirLocation, host, remoteDirLocation); executeCommand(command); {noformat} Does anybody know why? > Oozie ssh action Cannot run program "scp" > - > > Key: OOZIE-2576 > URL: https://issues.apache.org/jira/browse/OOZIE-2576 > Project: Oozie > Issue Type: Bug > Components: action >Affects Versions: 4.0.0 > Environment: Oozie server build version: 4.0.0-cdh5.2.0 >Reporter: ywheel >Priority: Blocker > > We used oozie ssh action in a production environment, the following xml codes > is the example: > {noformat} > > > > > root@192.168.1.154 > sh /tmp/test.sh > > > > > > > Action failed, error > message[${wf:errorMessage(wf:lastErrorNode())}] > > > > {noformat} > However, we meet the errors below: > {noformat} > 2016-06-12 22:30:54,713 INFO org.apache.oozie.action.ssh.SshActionExecutor: > SERVER[Master] USER[hdfs] GROUP[-] TOKEN[] APP[TestSsh] > JOB[201-160113124428061-oozie-oozi-W] > ACTION[201-160113124428061-oozie-oozi-W@ShellAction] Attempting to copy > ssh base scripts to remote host [root@192.168.1.154] > 2016-06-12 22:30:54,869 WARN org.apache.oozie.action.ssh.SshActionExecutor: > SERVER[Master] USER[hdfs] GROUP[-] TOKEN[] APP[TestSsh] > JOB[201-160113124428061-oozie-oozi-W] > ACTION[201-160113124428061-oozie-oozi-W@ShellAction] Error while > executing ssh EXECUTION > 2016-06-12 22:30:54,870 WARN org.apache.oozie.command.wf.ActionStartXCommand: > SERVER[Master] USER[hdfs] GROUP[-] TOKEN[] APP[TestSsh] > JOB[201-160113124428061-oozie-oozi-W] > ACTION[201-160113124428061-oozie-oozi-W@ShellAction] Error starting > action [ShellAction]. ErrorType [ERROR], ErrorCode [UNKOWN_ERROR], Message > [UNKOWN_ERROR: Cannot run program "scp": error=2, No such file or directory] > org.apache.oozie.action.ActionExecutorException: UNKOWN_ERROR: Cannot run > program "scp": error=2, No such file or directory > at > org.apache.oozie.action.ssh.SshActionExecutor.execute(SshActionExecutor.java:599) > at > org.apache.oozie.action.ssh.SshActionExecutor.start(SshActionExecutor.java:204) > at > org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:228) > at > org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:63) > at org.apache.oozie.command.XCommand.call(XCommand.java:281) > at > org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:323) > at > org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:252) > at > org.apache.oozie.service.CallableQueueService$CallableWrapper.run(CallableQueueService.java:174) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:744) > Caused by: java.io.IOException: Cannot run program "scp": error=2, No such > file or directory > at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) > at java.lang.Runtime.exec(Runtime.java:617) > at java.lang.Runtime.exec(Runtime.java:485) > at > org.apache.oozie.action.ssh.SshActionExecutor.executeCommand(SshActionExecutor.java:332) > at > org.apache.oozie.action.ssh.SshActionExecutor.setupRemote(SshActionExecutor.java:376) > at > org.apache.oozie.action.ssh.SshActionExecutor$1.call(SshActionExecutor.java:206) > at > org.apache.oozie.action.ssh.SshActionExecutor$1.call(SshActionExecutor.java:204) > at > org.apache.oozie.action.ssh.SshActionExecutor.execute(SshActionExecutor.java:548) > ... 10 more > Caused by: java.io.IOException: error=2, No such file or directory > at java.lang.UNIXProcess.forkAndExec(Native Method) > at java.lang.UNIXProcess.(UNIXProcess.java:135) > at java.lang.ProcessImpl.start(ProcessImpl.java:130) > at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) > ... 17 more > {noformat} > I checked the codes in {{org.apache.oozie.action.ssh.SshActionExecutor}} > class, and I found oozie would execute 'scp' command to copy two > files(ssh-base.sh,ssh-wrapper.sh) to the workspace folder on remote host. But > the logs could not show any informat