1

Here is a brief description of my current setup. We use

Git : revision control system Phabricator : Code Review Jenkins : for Continuous Integration and running builds. Plugins : Phabricator differential, windows slaves plugin

Jenkins setup has a linux master , and windows & Mac Slaves. I also have Phabricator Differential enabled on the projects , and arcanist installed on all the Jenkins Nodes.

While Running Windows Projects,the build fails with the following error message that says it can not find arc in the specified folder.I m however able to run arc from the folder manually, I have made sure that the environment variables are set properly.Has anyone run into this issue before ?

 `The system cannot find the file specified
    FATAL: command execution failed
    java.io.IOException: Cannot run program "sh" (in directory "C:\Users\Jenkins\workspace\windows_project"): CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at hudson.Proc$LocalProc.<init>(Proc.java:244)
        at hudson.Proc$LocalProc.<init>(Proc.java:216)
        at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
        at hudson.Launcher$ProcStarter.start(Launcher.java:382)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
        at hudson.remoting.UserRequest.perform(UserRequest.java:121)
        at hudson.remoting.UserRequest.perform(UserRequest.java:49)
        at hudson.remoting.Request$2.run(Request.java:325)
        at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at hudson.remoting.Engine$1$1.run(Engine.java:69)
        at java.lang.Thread.run(Thread.java:745)
        at ......remote call to winbuild2(Native Method)
        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1361)
        at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
        at hudson.remoting.Channel.call(Channel.java:753)
        at hudson.Launcher$RemoteLauncher.launch(Launcher.java:929)
        at hudson.Launcher$ProcStarter.start(Launcher.java:382)
        at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
        at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
        at hudson.model.Build$BuildExecution.build(Build.java:205)
        at hudson.model.Build$BuildExecution.doRun(Build.java:162)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
        at hudson.model.Run.execute(Run.java:1744)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:374)
    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>(ProcessImpl.java:386)
        at java.lang.ProcessImpl.start(ProcessImpl.java:137)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        at hudson.Proc$LocalProc.<init>(Proc.java:244)
        at hudson.Proc$LocalProc.<init>(Proc.java:216)
        at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
        at hudson.Launcher$ProcStarter.start(Launcher.java:382)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
        at hudson.remoting.UserRequest.perform(UserRequest.java:121)
        at hudson.remoting.UserRequest.perform(UserRequest.java:49)
        at hudson.remoting.Request$2.run(Request.java:325)`

arc error message:

[windows_box_testing] $ arc call-conduit differential.querydiffs
The system cannot find the file specified
FATAL: Cannot run program "arc" (in directory "C:\Users\Jenkins\workspace\windows_box_testing"): CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program "arc" (in directory "C:\Users\Jenkins\workspace\windows_box_testing"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
PhD
  • 35
  • 10
  • 2
    Well, are you sure that the problem is in running arc? To me, the log seems to indicate that it can't find `sh`. Is `sh` in your path? – Anders Jan 20 '16 at 07:21
  • ah ! thanks for pointing that out.. the can't run 'sh' turned out to be a one-off error ,and I havent seen it again. I have updated the question with the 'cant run arc' error message that I m running into. – PhD Jan 20 '16 at 23:55

1 Answers1

0

As mentioned by Anders, the log is indicating Cannot run program "sh". When you run arc on the box, are you running it from Windows Command Prompt or are you opening a linux-like shell.

For example, when I need to run arc commands on Windows, while logged in, I usually launch Git Bash, which does have a version of sh. However, to get that machine up and going as a build server with arc, I needed to install Cygwin and make Jenkins run the script in there.

I hope this helps.

CEPA
  • 2,592
  • 25
  • 31
  • thanks CEPA . I have updated the question with the error message that I wanted to ask about. The 'sh' error was a random error that I havent encountered again. So, even if I install cygwin - does Jenkins Windows Slave route all the commands through cygwin ? wouldn't it use the default windows shell ? – PhD Jan 20 '16 at 23:57
  • You can. You would need to implement a plugin to assist with that. However, I was discussing this with others on my team and found that we are currently divided on this topic. We have some builds that use the plugin and some that use standard command prompt. If you choose to stick with your slave as it's currently configured (and I can't blame you for choosing this), you can call arc by using `arcanist\bin\arc.bat`. This should get you what you need. Otherwise, you can look into utilizing the Cygwin plugins. – CEPA Jan 22 '16 at 15:30