java.io.IOException: Cannot run program "sh" (in directory "D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt"): CreateProcess error=2, The system cannot find the file specified

Jenkins JIRA | James Hancox | 3 years ago
  1. 0

    [JENKINS-20976] Tool tries to access non-existent file - Jenkins JIRA

    jenkins-ci.org | 1 year ago
    java.io.IOException: Cannot run program "sh" (in directory "D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt"): CreateProcess error=2, The system cannot find the file specified
  2. 0

    I often receive installer issues in "Custom Tools Plugin", which complain about "Run Command" behavior. Seems that its name and documentation are quite confusing, so I propose to slightly refactor them. An original issue from James Hancox: {quote} When I try to use the custom tools plugin to install a tool named "VxrAnt", I get the following error message: Started by user anonymous [CustomTools] - VxrAnt: Starting installation [VxrAnt] $ sh -e D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt\hudson7649328509533676101.sh The system cannot find the file specified FATAL: Cannot run program "sh" (in directory "D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt"): CreateProcess error=2, The system cannot find the file specified java.io.IOException: Cannot run program "sh" (in directory "D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) 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.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:63) at java.lang.Thread.run(Unknown Source) 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) ... 16 more As my install script does not call sh, I can only assume that this is part of the internal workings of the custom tools plugin which has gone awry. {quote}

    Jenkins JIRA | 3 years ago | James Hancox
    java.io.IOException: Cannot run program "sh" (in directory "D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt"): CreateProcess error=2, The system cannot find the file specified
  3. 0

    I often receive installer issues in "Custom Tools Plugin", which complain about "Run Command" behavior. Seems that its name and documentation are quite confusing, so I propose to slightly refactor them. An original issue from James Hancox: {quote} When I try to use the custom tools plugin to install a tool named "VxrAnt", I get the following error message: Started by user anonymous [CustomTools] - VxrAnt: Starting installation [VxrAnt] $ sh -e D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt\hudson7649328509533676101.sh The system cannot find the file specified FATAL: Cannot run program "sh" (in directory "D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt"): CreateProcess error=2, The system cannot find the file specified java.io.IOException: Cannot run program "sh" (in directory "D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) 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.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:63) at java.lang.Thread.run(Unknown Source) 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) ... 16 more As my install script does not call sh, I can only assume that this is part of the internal workings of the custom tools plugin which has gone awry. {quote}

    Jenkins JIRA | 3 years ago | James Hancox
    java.io.IOException: Cannot run program "sh" (in directory "D:\projects\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\VxrAnt"): CreateProcess error=2, The system cannot find the file specified
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Maven - Notifications - Build failed in Jenkins: maven-plugins-ITs-m3-windows #88 | Page 2

    nabble.com | 1 year ago
    java.io.IOException: Cannot run program "mvn.bat" (in directory "< ")>: CreateProcess error=2, The system cannot find the file specified
  6. 0

    Actually, issue captured on 1.3.9. After upgrade, it seems that plugin assumes cleartool binary to be "cleartool.cmd" instead of cleartool.exe. In at least clearcase 7.0.1.12, it results crashes of the plugin (see stacktrace below), even when trying to poll for changes. What's also interesting is that the build continues to be triggered all the time, so with eg. 1 minute "quiet period", every 1 minut there is a failed build. Building remotely on BarSlave in workspace D:\JenkinsData\workspace\FOO_RELEASE_Integration [FOO_RELEASE_Integration] $ "C:\Program Files\Rational\ClearCase\\bin\cleartool.cmd" lsview FOO_jenkins_integration_release [INFO] computeChangeLogBeforeCheckout = false [INFO] computeChangeLogAfterCheckout = false [FOO_RELEASE_Integration] $ "C:\Program Files\Rational\ClearCase\\bin\cleartool.cmd" startview FOO_jenkins_integration_release java.io.IOException: Cannot run program "C:\Program Files\Rational\ClearCase\\bin\cleartool.cmd" (in directory "D:\JenkinsData\workspace\FOO_RELEASE_Integration"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:709) at hudson.Launcher$ProcStarter.start(Launcher.java:338) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:934) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:901) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:60) at java.lang.Thread.run(Unknown Source) 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) ... 17 more [xUnit] [INFO] - Starting to record. [xUnit] [INFO] - Processing NUnit-Version N/A (default)

    Jenkins JIRA | 4 years ago | Waldek M
    java.io.IOException: Cannot run program "C:\Program Files\Rational\ClearCase\\bin\cleartool.cmd" (in directory "D:\JenkinsData\workspace\FOO_RELEASE_Integration"): 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

    CreateProcess error=2, The system cannot find the file specified

    at java.lang.ProcessImpl.create()
  2. Java RT
    ProcessBuilder.start
    1. java.lang.ProcessImpl.create(Native Method)
    2. java.lang.ProcessImpl.<init>(Unknown Source)
    3. java.lang.ProcessImpl.start(Unknown Source)
    4. java.lang.ProcessBuilder.start(Unknown Source)
    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:773)
    4. hudson.Launcher$ProcStarter.start(Launcher.java:353)
    5. hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:998)
    6. hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:965)
    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
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.FutureTask.run(Unknown Source)
    2. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    3. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    3 frames
  6. Hudson :: Remoting Layer
    Engine$1$1.run
    1. hudson.remoting.Engine$1$1.run(Engine.java:63)
    1 frame
  7. Java RT
    Thread.run
    1. java.lang.Thread.run(Unknown Source)
    1 frame