java.io.IOException: Cannot run program "rake.bat" (in directory "C:\jenkins\workspace\project\label\windows"): CreateProcess error=2, The system cannot find the file specified

Jenkins JIRA | Brad Leonard | 5 years ago
  1. 0

    In my case I have a multi-configuration project that needs to invoke a rake task on windows, mac, and linux environments. The job on the windows node fails to find 'rake.bat'. It is in the windows system PATH and I can run it from the local machine cmd prompt. I believe this would work if I could select "Rake" from the list of tool locations on the Node Configuration page for my windows slave. Installing the rake plugin does not add Rake to the list of node tool installations. The full error is: [windows] $ rake.bat build:release The system cannot find the file specified FATAL: rake execution failed java.io.IOException: Cannot run program "rake.bat" (in directory "C:\jenkins\workspace\project\label\windows"): 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:698) at hudson.Launcher$ProcStarter.start(Launcher.java:329) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:923) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:890) 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 java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 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 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 Build step 'Invoke Rake' marked build as failure Recording test results Notifying upstream projects of job completion Finished: FAILURE

    Jenkins JIRA | 5 years ago | Brad Leonard
    java.io.IOException: Cannot run program "rake.bat" (in directory "C:\jenkins\workspace\project\label\windows"): CreateProcess error=2, The system cannot find the file specified
  2. 0

    [JENKINS-11159] Rake Plugin invocation on windows cannot find rake.bat - Jenkins JIRA

    jenkins-ci.org | 7 months ago
    java.io.IOException: Cannot run program "rake.bat" (in directory "C:\jenkins\workspace\project\label\windows"): CreateProcess error=2, The system cannot find the file specified
  3. 0

    In my case I have a multi-configuration project that needs to invoke a rake task on windows, mac, and linux environments. The job on the windows node fails to find 'rake.bat'. It is in the windows system PATH and I can run it from the local machine cmd prompt. I believe this would work if I could select "Rake" from the list of tool locations on the Node Configuration page for my windows slave. Installing the rake plugin does not add Rake to the list of node tool installations. The full error is: [windows] $ rake.bat build:release The system cannot find the file specified FATAL: rake execution failed java.io.IOException: Cannot run program "rake.bat" (in directory "C:\jenkins\workspace\project\label\windows"): 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:698) at hudson.Launcher$ProcStarter.start(Launcher.java:329) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:923) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:890) 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 java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 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 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 Build step 'Invoke Rake' marked build as failure Recording test results Notifying upstream projects of job completion Finished: FAILURE

    Jenkins JIRA | 5 years ago | Brad Leonard
    java.io.IOException: Cannot run program "rake.bat" (in directory "C:\jenkins\workspace\project\label\windows"): 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

    How can I use an alternate path for a Jenkins slave SCM step (CVS)

    Google Groups | 5 years ago | Matthew Johnson
    java.io.IOException: cvs: not found
  6. 0

    java.io.IOException: Cannot run program "ant" - java pressing answers

    itanswerz.com | 1 year ago
    java.io.IOException: Cannot run program "ant" (in directory "/hudson/buildTool/src/bt"): error=2, No existe el fichero o el directorio

  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

    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:698)
    4. hudson.Launcher$ProcStarter.start(Launcher.java:329)
    5. hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:923)
    6. hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:890)
    6 frames
  4. Hudson :: Remoting Layer
    Request$2.run
    1. hudson.remoting.UserRequest.perform(UserRequest.java:118)
    2. hudson.remoting.UserRequest.perform(UserRequest.java:48)
    3. hudson.remoting.Request$2.run(Request.java:287)
    3 frames
  5. Java RT
    Thread.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    2. java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    3. java.util.concurrent.FutureTask.run(Unknown Source)
    4. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    5. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    6. java.lang.Thread.run(Unknown Source)
    6 frames