3

I am having an issue with Jenkins build agents seeming to disconnect and fail to run jobs randomly. The build agents (3 of them) are Windows VM’s running in Azure. Jenkins is configured to run as a service on each build agent. The Jenkins server is also an Azure VM running linux. Hoping someone in this group might have some ideas. Below is a stack trace of the error. Many times if you attempt the job again it will run successfully.

Started by user unknown or anonymous
[Office365connector] No webhooks to notify
[EnvInject] - Loading node environment variables.
FATAL: java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 104.46.0.58/104.46.0.58:52195
        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
        at hudson.remoting.Request.call(Request.java:202)
        at hudson.remoting.Channel.call(Channel.java:956)
        at hudson.FilePath.act(FilePath.java:1157)
        at org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvVarsForNode(EnvironmentVariablesNodeLoader.java:64)
        at org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:80)
        at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:44)
        at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:542)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:462)
        at hudson.model.Run.execute(Run.java:1810)
        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: hudson.remoting.RequestAbortedException
    at hudson.remoting.Request.abort(Request.java:340)
    at hudson.remoting.Channel.terminate(Channel.java:1040)
    at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:209)
    at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:222)
    at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:816)
    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:784)
    at org.jenkinsci.remoting.protocol.ApplicationLayer.doCloseWrite(ApplicationLayer.java:173)
    at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer$ByteBufferCommandTransport.closeWrite(ChannelApplicationLayer.java:314)
    at hudson.remoting.Channel.close(Channel.java:1452)
    at hudson.remoting.Channel.close(Channel.java:1405)
    at hudson.slaves.SlaveComputer.closeChannel(SlaveComputer.java:827)
    at hudson.slaves.SlaveComputer.access$800(SlaveComputer.java:104)
    at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:736)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
    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)
avidgoffer
  • 193
  • 1
  • 2
  • 18
  • 1
    The Jenkins slave on windows is running as service or process ? And what is the method or way to setup the slave ? – error404 Mar 12 '19 at 15:22
  • @yashbagarka it is running as a service on Windows. Here is the config for the client: C:\Program Files\Java\jre1.8.0_201\bin\java.exe -Xrs -jar "%BASE%\slave.jar" -jnlpUrl https://redacted.eastus2.cloudapp.azure.com/computer/inserternode1/slave-agent.jnlp -secret redacted – avidgoffer Mar 12 '19 at 16:28
  • Have a look at this thread https://stackoverflow.com/questions/45433225/jenkins-windows-slave-connection-getting-terminated-with-java-nio-channels-close – Pavel Anikhouski Mar 13 '19 at 08:45
  • can you check the logs on the slave node ? – error404 Mar 13 '19 at 10:56
  • Did you check this [link](https://stackoverflow.com/questions/45433225/jenkins-windows-slave-connection-getting-terminated-with-java-nio-channels-close)? – subir Jun 12 '19 at 13:22
  • Did you ever solve your problem? – tdensmore Jun 18 '19 at 12:33

0 Answers0