mjava.io.IOException: Cannot run program "/bin/sh" (in directory "/opt/hudson/jobs/AppName/workspace"): java.io.IOException: error=2, No such file or directory

Jenkins JIRA | tieTYT | 6 years ago
  1. 0

    Batch Task Plugin - hudson - Hudson Wiki

    hudson-ci.org | 1 year ago
    mjava.io.IOException: Cannot run program "/bin/sh" (in directory "/opt/hudson/jobs/AppName/workspace"): java.io.IOException: error=2, No such file or directory
  2. 0

    I named my project from "AppName" to "App Name" but the batch tasks are still trying to execute the script in the old path so it can't find the script. Here's the exception: workspace $ /bin/sh -xe /tmp/hudson3200245917642124053.sh FATAL: command execution failed [8mha:AAAAWB+LCAAAAAAAAABb85aBtbiIQSmjNKU4P08vOT+vOD8nVc8DzHWtSE4tKMnMz/PLL0ldFVf2c+b/lb5MDAwVRQxSaBqcITRIIQMEMIIUFgAAckCEiWAAAAA=[0mjava.io.IOException: Cannot run program "/bin/sh" (in directory "/opt/hudson/jobs/AppName/workspace"): java.io.IOException: error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at hudson.Proc$LocalProc.<init>(Proc.java:149) at hudson.Proc$LocalProc.<init>(Proc.java:121) at hudson.Launcher$LocalLauncher.launch(Launcher.java:638) at hudson.Launcher$ProcStarter.start(Launcher.java:273) at hudson.Launcher$ProcStarter.join(Launcher.java:280) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:83) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58) at hudson.plugins.batch_task.BatchRun.run(BatchRun.java:295) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:124) Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.<init>(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) ... 10 more

    Jenkins JIRA | 6 years ago | tieTYT
    mjava.io.IOException: Cannot run program "/bin/sh" (in directory "/opt/hudson/jobs/AppName/workspace"): java.io.IOException: error=2, No such file or directory
  3. 0

    Batch Task Plugin - Jenkins - Jenkins Wiki

    jenkins-ci.org | 4 months ago
    mjava.io.IOException: Cannot run program "/bin/sh" (in directory "/opt/hudson/jobs/AppName/workspace"): java.io.IOException: error=2, No such file or directory
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I named my project from "AppName" to "App Name" but the batch tasks are still trying to execute the script in the old path so it can't find the script. Here's the exception: workspace $ /bin/sh -xe /tmp/hudson3200245917642124053.sh FATAL: command execution failed [8mha:AAAAWB+LCAAAAAAAAABb85aBtbiIQSmjNKU4P08vOT+vOD8nVc8DzHWtSE4tKMnMz/PLL0ldFVf2c+b/lb5MDAwVRQxSaBqcITRIIQMEMIIUFgAAckCEiWAAAAA=[0mjava.io.IOException: Cannot run program "/bin/sh" (in directory "/opt/hudson/jobs/AppName/workspace"): java.io.IOException: error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at hudson.Proc$LocalProc.<init>(Proc.java:149) at hudson.Proc$LocalProc.<init>(Proc.java:121) at hudson.Launcher$LocalLauncher.launch(Launcher.java:638) at hudson.Launcher$ProcStarter.start(Launcher.java:273) at hudson.Launcher$ProcStarter.join(Launcher.java:280) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:83) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58) at hudson.plugins.batch_task.BatchRun.run(BatchRun.java:295) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:124) Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.<init>(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) ... 10 more

    Jenkins JIRA | 6 years ago | tieTYT
    mjava.io.IOException: Cannot run program "/bin/sh" (in directory "/opt/hudson/jobs/AppName/workspace"): java.io.IOException: error=2, No such file or directory
  6. 0

    Hudson is started with the following batch script: @echo off set HUDSON_HOME=C:\Work\hudson\hudsonHome java -jar hudson.war --javaHome=C:\Program Files\Java\jdk1.6.0_18 --prefix=/hudson --httpPort=8080 --webroot=C:\Work\hudson\winstoneHome --logfile=C:\Work\hudson\hudson.log running at the command prompt this command I experience the following error: C:\Work\hudson>java -jar hudson-cli.jar -s http://localhost:8080/hudson dist-fork -l master date t [distfork8999019989670479689.tmp] $ date /t ERROR: Failed to execute a process ←[8mha:AAAAVx+LCAAAAAAAAABb85aBtbiIQSmjNKU4P08vOT+vOD8nVc8DzHWtSE4tKMnMz/PLL0m1W6NqK7pC2JmJgaGiiETYMzhAYpZIAARpDCAgBF2FTYYAAAAA==←[0mjava.io.IOException: Cannot run program "date" (in directory C:\Work\hudson\hudsonHome\distfork8999019989670479689.tmp"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:149) at hudson.Proc$LocalProc.<init>(Proc.java:121) at hudson.Launcher$LocalLauncher.launch(Launcher.java:633) at hudson.Launcher$ProcStarter.start(Launcher.java:268) at hudson.Launcher$ProcStarter.join(Launcher.java:275) at hudson.plugins.distfork.DistForkCommand$1.run(DistForkCommand.java:147) at hudson.plugins.distfork.DistForkTask$1.run(DistForkTask.java:70) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 10 more whereas running the command directly at the DOS prompt no errors are generated: C:\Work\hudson>date /t 14/03/2010 if I explicitely ask for a new Windows command interpreter instance all is fine: C:\Work\hudson>java -jar hudson-cli.jar -s http://localhost:8080/hudson dist-fork -l master cmd /c date /t [distfork58286187552956103.tmp] $ cmd /c date /t 14/03/2010 should dist-fork do this automagically? I also noticed the prompt decoration does not really work in the DOS window. It seems related to Groovy Shell: C:\Work\hudson>java -jar hudson-cli.jar -s http://localhost:8080/hudson groovysh ←[32mGroovy Shell←[0m (1.6.0, JVM: 1.6.0_18) Type '←[1mhelp←[0m' or '←[1m\h←[0m' for help. ------------------------------------------------------------------------------- ←[1mgroovy:←[0m000←[1m>←[0m quit C:\Work\hudson>

    Jenkins JIRA | 7 years ago | Andrea Barbieri
    mjava.io.IOException: Cannot run program "date" (in directory C:\Work\hudson\hudsonHome\distfork8999019989670479689.tmp"): CreateProcess error=2, The system cannot find the file specified

    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

      java.io.IOException: error=2, No such file or directory

      at java.lang.UNIXProcess.<init>()
    2. Java RT
      ProcessBuilder.start
      1. java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
      2. java.lang.ProcessImpl.start(ProcessImpl.java:65)
      3. java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
      3 frames
    3. Hudson
      CommandInterpreter.perform
      1. hudson.Proc$LocalProc.<init>(Proc.java:149)
      2. hudson.Proc$LocalProc.<init>(Proc.java:121)
      3. hudson.Launcher$LocalLauncher.launch(Launcher.java:638)
      4. hudson.Launcher$ProcStarter.start(Launcher.java:273)
      5. hudson.Launcher$ProcStarter.join(Launcher.java:280)
      6. hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:83)
      7. hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
      7 frames
    4. hudson.plugins.batch_task
      BatchRun.run
      1. hudson.plugins.batch_task.BatchRun.run(BatchRun.java:295)
      1 frame
    5. Hudson
      Executor.run
      1. hudson.model.ResourceController.execute(ResourceController.java:88)
      2. hudson.model.Executor.run(Executor.java:124)
      2 frames