【问题标题】:Jenkins is unable to run arc詹金斯无法运行弧
【发布时间】:2016-01-20 01:34:36
【问题描述】:

这是我当前设置的简要说明。我们使用

Git:版本控制系统 Phabricator:代码审查 Jenkins:用于持续集成和运行构建。 插件:Phabricator 微分、windows slaves 插件

Jenkins 设置有一个 linux master 和 windows & Mac Slaves。我还在项目上启用了 Phabricator 差分,并在所有 Jenkins 节点上安装了奥术师。

在运行 Windows 项目时,构建失败并显示以下错误消息,指出在指定文件夹中找不到 arc。但是我可以从文件夹手动运行 arc,我已确保环境变量设置正确。以前有人遇到过这个问题吗?

 `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)`

弧形错误信息:

[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)

【问题讨论】:

  • 嗯,你确定问题出在运行 arc 上吗?对我来说,日志似乎表明它找不到sh。 sh 在你的路径中吗?
  • 啊!感谢您指出这一点.. 无法运行 'sh' 原来是一次性错误,我再也没有看到它。我已经用我遇到的“无法运行弧”错误消息更新了问题。

标签: jenkins continuous-integration phabricator arcanist


【解决方案1】:

正如安德斯所说,日志显示Cannot run program "sh"。当你在盒子上运行arc 时,你是从 Windows 命令提示符运行它还是打开一个类似 linux 的 shell。

例如,当我需要在 Windows 上运行 arc 命令时,在登录时,我通常会启动 Git Bash,它确实有一个 sh 版本。但是,要让该机器启动并作为带有 arc 的构建服务器,我需要安装 Cygwin 并让 Jenkins 在其中运行脚本。

我希望这会有所帮助。

【讨论】:

  • 感谢 CEPA 。我已经用我想问的错误消息更新了这个问题。 'sh' 错误是我没有再次遇到的随机错误。所以,即使我安装了 cygwin - Jenkins Windows Slave 是否通过 cygwin 路由所有命令?它不会使用默认的 windows shell 吗?
  • 你可以。您需要实现一个插件来帮助解决这个问题。但是,我正在与团队中的其他人讨论这个问题,发现我们目前在这个话题上存在分歧。我们有一些使用插件的构建和一些使用标准命令提示符的构建。如果您选择坚持使用当前配置的从站(我不能责怪您选择了这个),您可以使用arcanist\bin\arc.bat 调用 arc。这应该可以满足您的需求。否则,您可以考虑使用 Cygwin 插件。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多