詹金斯奴隶显示为离线

时间:2018-08-03 18:12:55

标签: jenkins

我从以前的同事那里继承了詹金斯。不幸的是,他这样做是在没有其他人参与的情况下完成的,因此我对Jenkins的了解无非就是编写脚本并将其扔到仪表板中。如果确实有遗漏,我会向您道歉。

这周我注意到没有几个报告。当我跳进Jenkins仪表板时,it shows that the slave is offline。我登录到安装了Jenkins从站的Windows服务器,尝试运行exe,并得到以下错误:

Unable to Run Jenkins-Slave.exe

那是我检出服务并发现Jenkins服务未运行的时候。我尝试运行它,但出现此错误:

Unable to Run Jenkins Slave Service

因为我不太了解这个问题的来龙去脉,所以我不太确定如何解决它。我尝试重新启动从服务器所在的服务器以及重新启动主服务器,但是我没有任何改变。

再次,我对此不太了解,因此不胜感激!

编辑:评论者要求提供的信息,这是我从日志中看到的信息。查看 slave.out.log ,我看到的是重复的内容:

Both error and output logs will be printed to C:\Temp\JenkinsSlave\remoting

我在 slave.err.log 中看到了这一点。这些是那里的最后一个条目。它们与位于 C:\ Temp \ JenkinsSlave \ remoting

的日志文件中的日志完全相同。

Jul 28, 2018 7:01:46 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Connecting to jenkinsmaster:61069 Jul 28, 2018 7:01:46 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Server reports protocol JNLP4-plaintext not supported, skipping Jul 28, 2018 7:01:46 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Server reports protocol JNLP3-connect not supported, skipping Jul 28, 2018 7:01:46 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Server reports protocol JNLP2-connect not supported, skipping Jul 28, 2018 7:01:46 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Server reports protocol JNLP-connect not supported, skipping Jul 28, 2018 7:01:46 PM hudson.remoting.jnlp.Main$CuiListener error SEVERE: The server rejected the connection: None of the protocols were accepted java.lang.Exception: The server rejected the connection: None of the protocols were accepted at hudson.remoting.Engine.onConnectionRejected(Engine.java:655) at hudson.remoting.Engine.innerRun(Engine.java:619) at hudson.remoting.Engine.run(Engine.java:455)

编辑1:因此,由于@MichaelPowers,我得以使奴隶重新联机。这是通过执行本文档How to Setup a node中的步骤4来完成的。这使奴隶重新联机,但我仍然无法运行与奴隶相关的工作。在日志中,我看到了这一点:

`

Aug 06, 2018 1:20:43 PM hudson.remoting.UserRequest perform
WARNING: LinkageError while performing UserRequest:hudson.util.RemotingDiagnostics$GetThreadDump@df9d05
java.lang.LinkageError: Failed to load hudson.init.InitMilestone
    at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:389)
    at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at hudson.util.RemotingDiagnostics$GetThreadDump.call(RemotingDiagnostics.java:98)
    at hudson.util.RemotingDiagnostics$GetThreadDump.call(RemotingDiagnostics.java:95)
    at hudson.remoting.UserRequest.perform(UserRequest.java:212)
    at hudson.remoting.UserRequest.perform(UserRequest.java:54)
    at hudson.remoting.Request$2.run(Request.java:369)
    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.lambda$newThread$0(Engine.java:93)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/jvnet/hudson/reactor/Milestone
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:383)
    ... 14 more
Caused by: java.lang.ClassNotFoundException: org.jvnet.hudson.reactor.Milestone
    at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:317)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 18 more
Caused by: java.nio.file.AccessDeniedException: C:\Temp\JenkinsSlave\remoting\jarCache\1D\802F741B5EFFEF0E027F560ADF37AB.jar
    at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
    at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
    at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
    at sun.nio.fs.WindowsFileAttributeViews$Basic.setFileTimes(Unknown Source)
    at sun.nio.fs.WindowsFileAttributeViews$Basic.setTimes(Unknown Source)
    at java.nio.file.Files.setLastModifiedTime(Unknown Source)
    at hudson.remoting.FileSystemJarCache.lookInCache(FileSystemJarCache.java:77)
    at hudson.remoting.JarCacheSupport.resolve(JarCacheSupport.java:46)
    at hudson.remoting.ResourceImageInJar._resolveJarURL(ResourceImageInJar.java:90)
    at hudson.remoting.ResourceImageInJar.resolve(ResourceImageInJar.java:43)
    at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:304)
    ... 20 more`

还有其他更新奴隶的方法吗?

我也从失败的工作中收到一封电子邮件:

`java.lang.ClassNotFoundException: org.jenkinsci.plugins.gitclient.Git$1
        at java.net.URLClassLoader.findClass(Unknown Source)
        at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at java.io.ObjectInputStream.resolveClass(Unknown Source)
        at hudson.remoting.MultiClassLoaderSerializer$Input.resolveClass(MultiClassLoaderSerializer.java:134)
        at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
        at java.io.ObjectInputStream.readClassDesc(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at hudson.remoting.UserRequest.deserialize(UserRequest.java:291)
        at hudson.remoting.UserRequest.perform(UserRequest.java:190)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from fhiscripts1.fhi.com/10.1.1.126:62844
                at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
                at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
                at hudson.remoting.Channel.call(Channel.java:955)
                at hudson.FilePath.act(FilePath.java:1036)
                at hudson.FilePath.act(FilePath.java:1025)
                at org.jenkinsci.plugins.gitclient.Git.getClient(Git.java:137)
                at hudson.plugins.git.GitSCM.createClient(GitSCM.java:821)
                at hudson.plugins.git.GitSCM.createClient(GitSCM.java:812)
                at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1180)
                at hudson.scm.SCM.checkout(SCM.java:504)
                at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
                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:1798)
                at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
                at hudson.model.ResourceController.execute(ResourceController.java:97)
                at hudson.model.Executor.run(Executor.java:429)
Caused: java.lang.ClassNotFoundException: Failed to deserialize the Callable object. Perhaps you needed to implement DelegatingCallable?
        at hudson.remoting.UserRequest.perform(UserRequest.java:192)
        at hudson.remoting.UserRequest.perform(UserRequest.java:54)
        at hudson.remoting.Request$2.run(Request.java:369)
        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.lambda$newThread$0(Engine.java:93)
        at java.lang.Thread.run(Unknown Source)
Caused: java.io.IOException: Remote call on JNLP4-connect connection from fhiscripts1.fhi.com/10.1.1.126:62844 failed
        at hudson.remoting.Channel.call(Channel.java:959)
        at hudson.FilePath.act(FilePath.java:1036)
        at hudson.FilePath.act(FilePath.java:1025)
        at org.jenkinsci.plugins.gitclient.Git.getClient(Git.java:137)
        at hudson.plugins.git.GitSCM.createClient(GitSCM.java:821)
        at hudson.plugins.git.GitSCM.createClient(GitSCM.java:812)
        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1180)
        at hudson.scm.SCM.checkout(SCM.java:504)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
        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:1798)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:97)
        at hudson.model.Executor.run(Executor.java:429)`

最终编辑:

好消息,我想一旦能够使奴隶重新上线,我要做的就是更新插件。我去了 Manage Jenkins> Manage Plugins ,并能够更新所有需要它的插件。重新启动后,我能够毫无问题地运行与从属服务器绑定的作业。

再次感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

当您的Jenkins主服务器和从服务器不同意使用哪种协议时,会发生此错误。通常在服务器升级(版本或安全策略)并且从服务器不再讲话时发生这种情况,因为主服务器和服务器不再讲任何常见的方言。

首先要尝试的是upgrading the Jenkins slave runner(请参阅第4步)。

如果不能解决问题,另一种选择是允许母版中使用Jenkins协议的较早方言。您可以通过管理Jenkins->配置全局安全性->代理->代理协议... Picture of Agent Protocol selector in Jenkins

只需检查从站支持的协议之一,并且从站应该能够再次连接。不过,由于这些协议通常由于某种原因而被禁用,因此您可能会在Jenkins控制台中收到安全警告。