我正在尝试配置 Hudson 以从 Mercurial 检出我的站点源,但它引发了异常。 /var/lib/hudson/jobs/jobname 目录确实存在,我可以在其中创建一个工作区目录(即使在 su hudson 之后),但只要我再次运行 Hudson 作业,该目录就会消失,作业会以相同的错误结束:
java.io.IOException: Cannot run program "hg" (in directory "/var/lib/hudson/jobs/jobname/workspace"): java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at hudson.Proc$LocalProc.<init>(Proc.java:192)
at hudson.Proc$LocalProc.<init>(Proc.java:164)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:639)
at hudson.Launcher$ProcStarter.start(Launcher.java:274)
at hudson.Launcher$ProcStarter.join(Launcher.java:281)
at hudson.plugins.mercurial.MercurialSCM.joinWithPossibleTimeout(MercurialSCM.java:298)
at hudson.plugins.mercurial.HgExe.popen(HgExe.java:191)
at hudson.plugins.mercurial.HgExe.tip(HgExe.java:171)
at hudson.plugins.mercurial.MercurialSCM.calcRevisionsFromBuild(MercurialSCM.java:254)
at hudson.scm.SCM._calcRevisionsFromBuild(SCM.java:304)
at hudson.model.AbstractProject.calcPollingBaseline(AbstractProject.java:1183)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1172)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:499)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:415)
at hudson.model.Run.run(Run.java:1362)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
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:453)
在 Debian 6.0.1 上运行
我想知道是否有人遇到过这个问题并希望能够解决它?
答案1
呃,我忽略了输出中的这条消息:
$ hg clone --rev default http://frodo/cgi-bin/hgwebdir.cgi/projectname "/var/lib/hudson/jobs/jobname/workspace" abort: unknown revision 'default'!
我已经在项目上运行了 hg init,但没有运行 hg add 和 hg commit,所以没有什么可克隆的!
添加并提交文件后一切顺利......