简体   繁体   English

运行jenkins slave作为服务jenkins 2.89

[英]Running jenkins slave as service jenkins 2.89

I am trying to connect my windows slave as a service to jenkins 2.88. 我正在尝试将Windows Slave作为服务连接到Jenkins 2.88。 I did so by starting the slave via webstart and then ran jenkins-slave.exe install to install the service. 我是通过webstart启动从站,然后运行jenkins-slave.exe install来安装服务的。 When running a job for the second time, which checks out things from svn i get the following error: 当第二次运行作业时,这会从svn中检查出东西,我得到以下错误:

Started by user XXX
Building remotely on Tobias_testnod (Excel) in workspace <PATH_TO_WORKSPACE>
Cleaning local Directory XXX/YYY
java.nio.file.DirectoryNotEmptyException: C:\<path_>\.svn\pristine
    at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
    at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown Source)
    at java.nio.file.Files.deleteIfExists(Unknown Source)
    at hudson.Util.tryOnceDeleteFile(Util.java:290)
    at hudson.Util.tryOnceDeleteRecursive(Util.java:370)
    at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
    at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
    at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
    at hudson.Util.deleteContentsRecursive(Util.java:225)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from <HOST>
        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1655)
        at hudson.remoting.UserResponse.retrieve(UserRequest.java:308)
        at hudson.remoting.Channel.call(Channel.java:904)
        at hudson.FilePath.act(FilePath.java:986)
        at hudson.FilePath.act(FilePath.java:975)
        at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:902)
        at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:838)
        at hudson.scm.SCM.checkout(SCM.java:495)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
        at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
        at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
        at hudson.model.Run.execute(Run.java:1724)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:97)
        at hudson.model.Executor.run(Executor.java:421)
Caused: java.io.IOException: Unable to delete <PATH>. Tried 3 times (of a maximum of 3) waiting 0,1 sec between attempts.
    at hudson.Util.deleteContentsRecursive(Util.java:230)
    at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:81)
    at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:162)
    at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:1001)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:977)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:953)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2760)
    at hudson.remoting.UserRequest.perform(UserRequest.java:205)
    at hudson.remoting.UserRequest.perform(UserRequest.java:52)
    at hudson.remoting.Request$2.run(Request.java:356)
    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:98)
    at java.lang.Thread.run(Unknown Source)
Caused: java.io.IOException: remote file operation failed: <PATH_TO_WORKSPACE> at hudson.remoting.Channel@1fe2698:JNLP4-connect connection from <HOST>
    at hudson.FilePath.act(FilePath.java:993)
    at hudson.FilePath.act(FilePath.java:975)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:902)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:838)
    at hudson.scm.SCM.checkout(SCM.java:495)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
    at hudson.model.Run.execute(Run.java:1724)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:421)
Archiving artifacts

The service is running as my user in order for it to have all neccessary permissions. 该服务以我的用户身份运行,以使其具有所有必要的权限。 Now my question in short is whether the approach of running the jenkins-slave jar from a service is properly supported from jenkins. 现在简而言之,我的问题是jenkins是否正确支持从服务运行jenkins-slave jar的方法。 I could for example not install it from the window which appeared when starting via webstart as it did not have sufficent privileges. 例如,我无法从通过webstart启动时出现的窗口中安装它,因为它没有足够的权限。 Instead I had to install it manually from the commandline running as admin. 相反,我不得不从以管理员身份运行的命令行手动安装它。

So is the service option really working properly? 那么服务选件真的可以正常工作吗? Or should i just drop it and connect from a commandshell instead? 还是我应该放下它,然后从Commandshell连接? If anyone knows exactly what is wrong of course I would be happy for any assistance regarding the error too :). 如果有人确切地知道哪里出了问题,我当然也很乐意为您提供有关该错误的帮助:)。 i am running java 1.8 on both the master and the slave. 我在主服务器和从服务器上都运行Java 1.8。

It seems to be a memory-related issue. 这似乎是与内存有关的问题。 See this Jenkins bug for a workaround. 请参阅此Jenkins错误以获取解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM