Windows 10 node and ssh-slave plugin

39 views
Skip to first unread message

christoph...@inria.fr

unread,
Sep 25, 2018, 3:39:49 PM9/25/18
to Jenkins Users
Hello,

I would like to know if the ssh-slave plugin is supposed to work to run the slave agent on a Windows 10 node with Open SSH (Microsoft port)?
I tried but I got some issues:
1/ the plugin assumes a command named true exists for the shell being executed (ok for bash but not for cmd, the shell being launched on Windows). A workaround is to create a true.bat file having the expected behaviour, e.g. @%COMSPEC% /C exit 1 >nul
2/ the plugin then tries to run the java command to determine Java version but, even if the java executable is in the Windows PATH, the plugin does not find it. Same workaround here: create a java.bat file that runs jave with an absolute path.
3/ The last problem I’m not able to solve is an exception during the launch of the slave agent (stacktrace below):
java.io.IOException: Unexpected termination of the channel

Any idea of what could be wrong?

Best regards,
Christophe.

StackTrace:
[09/25/18 20:45:55] [SSH] Checking java version of java
[09/25/18 20:45:56] [SSH] java -version returned 1.8.0_181.
[09/25/18 20:45:56] [SSH] Starting sftp client.
[09/25/18 20:45:56] [SSH] Copying latest slave.jar...
[09/25/18 20:45:56] [SSH] Copied 745,674 bytes.
Expanded the channel window size to 4MB
[09/25/18 20:45:56] [SSH] Starting slave process: cd "c:\builds" && java  -jar slave.jar
<===[JENKINS REMOTING CAPACITY]===>
ci@DESKTOP-IG838MJ c:\builds>"C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe" -jar slave.jar 
<===[JENKINS REMOTING CAPACITY]===>ERROR: Connection terminated
ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected termination of the channel
	at hudson.remoting.Request.abort(Request.java:329)
	at hudson.remoting.Channel.terminate(Channel.java:992)
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:96)
	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to win10
		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.slaves.SlaveComputer.setChannel(SlaveComputer.java:546)
		at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:413)
		at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:1110)
		at hudson.plugins.sshslaves.SSHLauncher.access$500(SSHLauncher.java:148)
		at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:845)
		at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:820)
		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)
Caused by: java.io.IOException: Unexpected termination of the channel
java.io.EOFException
	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2675)
	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3150)
	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:859)
	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:355)
	at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
Caused: java.io.IOException: Unexpected termination of the channel
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
Caused by: java.io.EOFException
	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2675)
	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3150)
	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:859)
	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:355)
	at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)

Ivan Fernandez Calvo

unread,
Sep 26, 2018, 1:38:27 PM9/26/18
to Jenkins Users
HI,

Take a look to https://issues.jenkins-ci.org/browse/JENKINS-42856 I think that it is the same issue, there is a workaround, see my last comments, It does not work I can help you on that issue.

Christophe Demarey

unread,
Sep 27, 2018, 4:58:50 AM9/27/18
to jenkins...@googlegroups.com
Hi,

Thanks a lot for this information. Very useful.
I’ll give you feedback once I tested that.

Christophe.

-- 
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/_2d1_4C6V5o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a20632aa-36e5-43d7-b5b2-edcd6b9a0d8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages