java.io.IOException: Cannot run program "Documents/jar_sources/tools/hudson.tasks.Ant_AntInstallation/ant-test/bin/ant" (in directory "Documents/jar_sources/workspace/Test MATT Plugin"): error=2, No such file or directory

Jenkins JIRA | Mukul Sharma | 4 years ago
  1. 0

    Steps to reproduce - 1. Create a Jenkins slave node. 2. Specify the "Remote FS Root" value of the slave as a relative path. 3. Use any auto-install tool, for example Ant (by adding Ant Installation settings in Jenkins configuration) 4. Run a build with "Invoke Ant" task. This task should use the version of Ant setup in the Ant-Installation settings. 5. Build fails as it is unable to find the recently downloaded ant binary. Sample Build Output - Started by user anonymous Building remotely on Test Node in workspace Documents/jar_sources/workspace/Test MATT Plugin Unpacking http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.0-bin.zip to Documents/jar_sources/tools/hudson.tasks.Ant_AntInstallation/ant-test on Test Node [Test MATT Plugin] $ Documents/jar_sources/tools/hudson.tasks.Ant_AntInstallation/ant-test/bin/ant clean FATAL: command execution failed. java.io.IOException: Cannot run program "Documents/jar_sources/tools/hudson.tasks.Ant_AntInstallation/ant-test/bin/ant" (in directory "Documents/jar_sources/workspace/Test MATT Plugin"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:763) at hudson.Launcher$ProcStarter.start(Launcher.java:353) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:988) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:955) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:53) at java.lang.ProcessImpl.start(ProcessImpl.java:91) at java.lang.ProcessBuilder.start(ProcessBuilder.java:453) ... 15 more Build step 'Invoke Ant' marked build as failure Finished: FAILURE

    Jenkins JIRA | 4 years ago | Mukul Sharma
    java.io.IOException: Cannot run program "Documents/jar_sources/tools/hudson.tasks.Ant_AntInstallation/ant-test/bin/ant" (in directory "Documents/jar_sources/workspace/Test MATT Plugin"): error=2, No such file or directory
  2. 0

    Steps to reproduce - 1. Create a Jenkins slave node. 2. Specify the "Remote FS Root" value of the slave as a relative path. 3. Use any auto-install tool, for example Ant (by adding Ant Installation settings in Jenkins configuration) 4. Run a build with "Invoke Ant" task. This task should use the version of Ant setup in the Ant-Installation settings. 5. Build fails as it is unable to find the recently downloaded ant binary. Sample Build Output - Started by user anonymous Building remotely on Test Node in workspace Documents/jar_sources/workspace/Test MATT Plugin Unpacking http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.0-bin.zip to Documents/jar_sources/tools/hudson.tasks.Ant_AntInstallation/ant-test on Test Node [Test MATT Plugin] $ Documents/jar_sources/tools/hudson.tasks.Ant_AntInstallation/ant-test/bin/ant clean FATAL: command execution failed. java.io.IOException: Cannot run program "Documents/jar_sources/tools/hudson.tasks.Ant_AntInstallation/ant-test/bin/ant" (in directory "Documents/jar_sources/workspace/Test MATT Plugin"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:763) at hudson.Launcher$ProcStarter.start(Launcher.java:353) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:988) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:955) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:53) at java.lang.ProcessImpl.start(ProcessImpl.java:91) at java.lang.ProcessBuilder.start(ProcessBuilder.java:453) ... 15 more Build step 'Invoke Ant' marked build as failure Finished: FAILURE

    Jenkins JIRA | 4 years ago | Mukul Sharma
    java.io.IOException: Cannot run program "Documents/jar_sources/tools/hudson.tasks.Ant_AntInstallation/ant-test/bin/ant" (in directory "Documents/jar_sources/workspace/Test MATT Plugin"): error=2, No such file or directory
  3. 0

    problems with hg plugin

    Google Groups | 5 years ago | Matt Fair
    java.io.IOException: Cannot run program "hg" (in directory "...."): error=2, No such file or directory
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Executing a grails build on a remote slave seems to fail in an odd way. The path to the grails command, or the grailsw command is incorrect. With the grails wrapper, this is what happens. ----------- Started by user David Dawson Building remotely on Ubuntu 13.10 (i-2d823961) in workspace workspace/Grails - GWT Plugin Package Fetching changes from the remote Git repository Fetching upstream changes from https://github.com/simplicityitself/grails-gwt.git Checking out Revision c998432b9968ad627a624265354bd71623b2eff3 (origin/extended-dependency) [Grails - GWT Plugin Package] $ "workspace/Grails - GWT Plugin Package/grailsw" "-Dgrails.work.dir=/home/ubuntu/workspace/Grails - GWT Plugin Package//target" upgrade --non-interactive --plain-output --refresh-dependencies FATAL: command execution failed java.io.IOException: Cannot run program "workspace/Grails - GWT Plugin Package/grailsw" (in directory "workspace/Grails - GWT Plugin Package"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:773) at hudson.Launcher$ProcStarter.start(Launcher.java:353) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:998) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:965) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) 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:724) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:135) at java.lang.ProcessImpl.start(ProcessImpl.java:130) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) ... 15 more Build step 'Build With Grails' marked build as failure Finished: FAILURE ------------ Note the path to the grails wrapper has the workspace name in it, even though it is being executed within the workspace. For an auto installed grails, this is what happens ------------ Started by user David Dawson Building remotely on Ubuntu 13.10 (i-2d823961) in workspace workspace/Grails - GWT Plugin Package Fetching changes from the remote Git repository Fetching upstream changes from https://github.com/simplicityitself/grails-gwt.git Checking out Revision c998432b9968ad627a624265354bd71623b2eff3 (origin/extended-dependency) Unpacking http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.3.1.zip to tools/com.g2one.hudson.grails.GrailsInstallation/2.3.1 on Ubuntu 13.10 (i-2d823961) [Grails - GWT Plugin Package] $ tools/com.g2one.hudson.grails.GrailsInstallation/2.3.1/bin/grails "-Dgrails.work.dir=/home/ubuntu/workspace/Grails - GWT Plugin Package//target" upgrade --non-interactive --plain-output --refresh-dependencies FATAL: command execution failed java.io.IOException: Cannot run program "tools/com.g2one.hudson.grails.GrailsInstallation/2.3.1/bin/grails" (in directory "workspace/Grails - GWT Plugin Package"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:773) at hudson.Launcher$ProcStarter.start(Launcher.java:353) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:998) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:965) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) 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:724) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:135) at java.lang.ProcessImpl.start(ProcessImpl.java:130) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) ... 15 more Build step 'Build With Grails' marked build as failure Finished: FAILURE -------------- Note the relative path in use. Effectively, I can't get this to work on a remote slave. Workarounds, fixes or suggestions on how I've done this wrong welcome. I can give access to the jenkins master that this is happening on if that helps.

    Jenkins JIRA | 3 years ago | David Dawson
    java.io.IOException: Cannot run program "tools/com.g2one.hudson.grails.GrailsInstallation/2.3.1/bin/grails" (in directory "workspace/Grails - GWT Plugin Package"): error=2, No such file or directory
  6. 0

    The below fails, simply because /tmp/jenkins does not exist. The environment is, naturally, per configuration should be set up on EC2 slave where /tmp/jenkins is actually created. {noformat} GitHub pull request #58 of commit 9834759834759834759834759834459843 automatically merged. [EnvInject] - Loading node environment variables. [EnvInject] - Preparing an environment for the build. [EnvInject] - Keeping Jenkins build variables. [EnvInject] - Executing and processing the following script content: #!/bin/bash -eEu #Prepare an environment for the run exit 0 [jenkins] $ /bin/bash -eEu /tmp/hudson7316054252745307440.sh ERROR: SEVERE ERROR occurs org.jenkinsci.lib.envinject.EnvInjectException: Error occurs on execution script file path at org.jenkinsci.plugins.envinject.service.EnvInjectScriptExecutor.executeScriptContent(EnvInjectScriptExecutor.java:99) at org.jenkinsci.plugins.envinject.service.EnvInjectScriptExecutor.executeScriptSection(EnvInjectScriptExecutor.java:49) at org.jenkinsci.plugins.envinject.service.EnvInjectEnvVars.executeScript(EnvInjectEnvVars.java:107) at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironmentJobPropertyObject(EnvInjectListener.java:179) at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:44) at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:581) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:487) at hudson.model.Run.execute(Run.java:1706) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:232) Caused by: java.io.IOException: Cannot run program "/bin/bash" (in directory "/tmp/jenkins"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:780) at hudson.Launcher$ProcStarter.start(Launcher.java:360) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1111) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1078) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(FutureTask.java:262) 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:745) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:186) at java.lang.ProcessImpl.start(ProcessImpl.java:130) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028) ... 14 more Finished: FAILURE {noformat}

    Jenkins JIRA | 2 years ago | Arcadiy Ivanov
    org.jenkinsci.lib.envinject.EnvInjectException: Error occurs on execution script file path

  1. eti22 1 times, last 1 month ago
  2. asdasd 24 times, last 3 months ago
  3. rexgreenza 8 times, last 3 months ago
  4. Benj-AD 1 times, last 4 months ago
  5. Akshay 4 times, last 6 months ago
95 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.IOException

    error=2, No such file or directory

    at java.lang.UNIXProcess.forkAndExec()
  2. Java RT
    ProcessBuilder.start
    1. java.lang.UNIXProcess.forkAndExec(Native Method)
    2. java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
    3. java.lang.ProcessImpl.start(ProcessImpl.java:91)
    4. java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    4 frames
  3. Hudson
    Launcher$RemoteLaunchCallable.call
    1. hudson.Proc$LocalProc.<init>(Proc.java:244)
    2. hudson.Proc$LocalProc.<init>(Proc.java:216)
    3. hudson.Launcher$LocalLauncher.launch(Launcher.java:763)
    4. hudson.Launcher$ProcStarter.start(Launcher.java:353)
    5. hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:988)
    6. hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:955)
    6 frames
  4. Hudson :: Remoting Layer
    InterceptingExecutorService$1.call
    1. hudson.remoting.UserRequest.perform(UserRequest.java:118)
    2. hudson.remoting.UserRequest.perform(UserRequest.java:48)
    3. hudson.remoting.Request$2.run(Request.java:326)
    4. hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    4 frames
  5. Java RT
    Thread.run
    1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    2. java.util.concurrent.FutureTask.run(FutureTask.java:138)
    3. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    5. java.lang.Thread.run(Thread.java:680)
    5 frames