1

Slave.jar expecting linux files on Windows node

I have a hybrid Kubernetes cluster with a Linux master and windows slave node. The Kubernetes plugin is set up to start up with a custom container that executes this command at the end of an internal script "java -cp C:\slave.jar hudson.remoting.jnlp.Main -headless -url http://172.31.50.121:8080 -workDirC:\jenkins\agents <secert> <pod name>". The widows pod connects to the jenkins master fine, however throws an error immediately ending the build.

java.nio.file.NoSuchFileException: \etc\hostname
	...
Caused: java.io.IOException
	...
Finished: FAILURE


And the logs from the container is:


Aug 13, 2018 8:02:08 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: windows-jnlp-8qzm5
Aug 13, 2018 8:02:08 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Aug 13, 2018 8:02:09 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 3.21
Aug 13, 2018 8:02:09 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using C:\jenkins\remoting as a remoting work directory
Both error and output logs will be printed to C:\jenkins\remoting
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http://172.31.50.121:8080]
Aug 13, 2018 8:02:09 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, CLI2-connect, JNLP-connect, Ping, CLI-connect, JNLP2-connect]
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Agent discovery successful
Agent address: 172.31.50.121
Agent port: 50000
Identity: 19:cd:77:66:ee:19:26:e8:df:4a:ea:c2:4e:ae:da:3d
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to 172.31.50.121:50000
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP4-connect
Aug 13, 2018 8:02:11 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Remote identity confirmed: 19:cd:77:66:ee:19:26:e8:df:4a:ea:c2:4e:ae:da:3d
Aug 13, 2018 8:02:12 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
Aug 13, 2018 8:02:15 PM hudson.remoting.Request$2 run
INFO: Failed to send back a reply to the request hudson.remoting.Request$2@6efad725: hudson.remoting.ChannelClosedException: Channel "hudson.remoting.Channel@407b3d4a:JNLP4-connect connection to 172.31.50.121/172.31.50.121:50000": channel is already closed
Aug 13, 2018 8:02:15 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Terminated

Based on these error I think its expecting a Linux environment.Is slave.jar for Linux vms only? Or do I need to specify in the argument its is windows?

3 comments

  • 1
    Avatar
    Denys Digtiar

    The `slave.jar` is multiplatform.

    There is a Linux container named "jnlp" that is implicitly added if not overridden. Maybe it has something to do with the error you see https://github.com/jenkinsci/kubernetes-plugin#constraints

     

  • 1
    Avatar
    Ovven Day

    In my setup I already have overwritten the linux "jnlp" with my own windows config with the name "jnlp". I also recieved a different error since wednesday:

    Aug 15, 2018 8:06:18 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Connected
    Aug 15, 2018 8:06:20 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Terminated
    Aug 15, 2018 8:06:20 PM hudson.remoting.JarCacheSupport$1 run
    WARNING: Failed to resolve a jar a8eac714f1e2fe381c068493abefe27b
    java.io.IOException: Failed to write to C:\jenkins\agents\remoting\jarCache\A8\EAC714F1E2FE381C068493ABEFE27B.jar
    at hudson.remoting.FileSystemJarCache.retrieve(FileSystemJarCache.java:142)
    at hudson.remoting.JarCacheSupport$1.run(JarCacheSupport.java:64)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: Backing channel 'JNLP4-connect connection to 172.31.50.121/172.31.50.121:50000' is disconnected.
    at hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:192)
    at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:257)
    at com.sun.proxy.$Proxy3.writeJarTo(Unknown Source)
    at hudson.remoting.FileSystemJarCache.retrieve(FileSystemJarCache.java:107)
    ... 5 more
    Caused by: hudson.remoting.Channel$OrderlyShutdown
    at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1129)
    at hudson.remoting.Channel$1.handle(Channel.java:527)
    at hudson.remoting.AbstractByteBufferCommandTransport.processCommand(AbstractByteBufferCommandTransport.java:202)
    at hudson.remoting.AbstractByteBufferCommandTransport.receive(AbstractByteBufferCommandTransport.java:188)
    at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onRead(ChannelApplicationLayer.java:186)
    at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecv(ApplicationLayer.java:207)
    at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecv(ProtocolStack.java:669)
    at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processRead(SSLEngineFilterLayer.java:369)
    at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecv(SSLEngineFilterLayer.java:117)
    at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecv(ProtocolStack.java:669)
    at org.jenkinsci.remoting.protocol.NetworkLayer.onRead(NetworkLayer.java:136)
    at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer.access$2200(BIONetworkLayer.java:48)
    at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader.run(BIONetworkLayer.java:283)
    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)
    ... 1 more
    Caused by: Command close created at
    at hudson.remoting.Command.<init>(Command.java:65)
    at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:1265)
    at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:1263)
    at hudson.remoting.Channel.close(Channel.java:1436)
    at hudson.remoting.Channel.close(Channel.java:1403)
    at hudson.slaves.SlaveComputer.closeChannel(SlaveComputer.java:769)
    at hudson.slaves.SlaveComputer.access$800(SlaveComputer.java:102)
    at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:687)
    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)

    Is this error because the connection "terminated", then tries to preform the write command? or did the fail to write error cause the "terminated" connection:

    Aug 15, 2018 8:06:18 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Connected
    Aug 15, 2018 8:06:20 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Terminated

    Or Am I missing a jarcache file or does the command not have high enough authority to write?

     

  • 0
    Avatar
    Denys Digtiar

    The jar is being retrieved from the Jenkins Master but the backing channel between agent and master is closed. The cause is an `OrderlyShutdown` and there is the exact source where `Close` command originated but the exact version of Core need to be available to track down the lines of code that did it.

Please sign in to leave a comment.