java - jenkins 主连接失败,出现 java.nio.channels.ClosedChannelException

标签 java git jenkins jenkins-plugins ubuntu-16.04

我有一个每小时运行一次的作业,从主机(Ubuntu 上的 Jenkins)到作为从机的 Windows 10 机器,30-40% 的时间作业只是失败并出现以下错误。我需要一些帮助,从哪里开始寻找或可能的解决方案是什么。

Master 和 Slave 都有相同的 Java 版本“1.8.0_151”

   FATAL: java.nio.channels.ClosedChannelException
   java.nio.channels.ClosedChannelException
   Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from p578c1cb8.dip0.t-ipconnect.de/67.110.18.114:55940
    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
        at hudson.remoting.Request.call(Request.java:192)
        at hudson.remoting.Channel.call(Channel.java:907)
        at hudson.FilePath.act(FilePath.java:986)
        at hudson.FilePath.act(FilePath.java:975)
        at hudson.FilePath.mkdirs(FilePath.java:1158)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:1200)
        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: hudson.remoting.RequestAbortedException
    at hudson.remoting.Request.abort(Request.java:329)
    at hudson.remoting.Channel.terminate(Channel.java:992)
    at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:208)
    at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:222)
    at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:832)
    at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287)
    at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:181)
    at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.switchToNoSecure(SSLEngineFilterLayer.java:283)
    at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processWrite(SSLEngineFilterLayer.java:503)
    at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processQueuedWrites(SSLEngineFilterLayer.java:248)
    at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doSend(SSLEngineFilterLayer.java:200)
    at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doCloseSend(SSLEngineFilterLayer.java:213)
    at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.doCloseSend(ProtocolStack.java:800)
    at org.jenkinsci.remoting.protocol.ApplicationLayer.doCloseWrite(ApplicationLayer.java:173)
    at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer$ByteBufferCommandTransport.closeWrite(ChannelApplicationLayer.java:311)
    at hudson.remoting.Channel.close(Channel.java:1405)
    at hudson.remoting.Channel.close(Channel.java:1358)
    at hudson.slaves.SlaveComputer.closeChannel(SlaveComputer.java:737)
    at hudson.slaves.SlaveComputer.access$800(SlaveComputer.java:96)
    at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:655)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
ERROR: Step ‘Publish Robot Framework test results’ failed: no workspace for T_REG #117
ERROR: Step ‘E-mail Notification’ failed: no workspace for T_REG #117
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
ERROR: Error: No workspace found!
Sending email to: tw.aa@gmail.com
Finished: FAILURE

最佳答案

看起来您可能对在虚拟奴隶上使用 secret 凭证有疑问。

来自 Here :

... best path forward is to create a git client authentication token class which uses AuthenticationTokens.convert() to map specific credentials (username/password or ssh private key) to the git client, then that git client authentication token would be sent over the wire from the master to the agent, rather than sending the Secret over the wire.

也许尝试使用 credential plugin

我还可以建议从代码段中删除您的电子邮件

关于java - jenkins 主连接失败,出现 java.nio.channels.ClosedChannelException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48342338/

相关文章:

java - 线程作为 GC 根

新精简团队的 Git 分支策略

grails - Jenkins grails错误java.lang.ClassNotFoundException:geb.transform.AttributeAccessingMetaClassRegisteringTransformation

intellij-idea - FindBugs 仅显示方法中的第一个错误(Jenkins、IntelliJ IDEA)

java - 尝试单击包含空格的超链接

java - App Engine 中的搜索引擎友好 URL - Java

git - 字体 Font Awesome 在 Git 克隆/pull 后显示为框?

git - 是否有在 git reset 上运行的 git hook?

phpunit - 排除 pdepend、phpmd、phpcpd、phpcs、phpdoc、phploc 中的某些目录和文件

java - Spring MethodInvokingBean - DriverManagerDataSource 不接受返回的值