Windows agent over SSH, "execute request failed" (Windows 8, OpenSSH)

634 views
Skip to first unread message

fross

unread,
Sep 4, 2016, 12:47:03 AM9/4/16
to Jenkins Users
Hello,

I'm trying to launch a Windows slave agent over SSH without success so far. The agent is running Windows 8 and uses the Win64 port of OpenSSH (see here and here). Is the request failing because of the SSH channel or because the agent is not supporting the bash Unix shell? So far I've been able to establish a connection between the master (Windows) and the agent using a regular SSH client with a user/password combination and also using public key authentication.

Any help regarding this would be greatly appreciated! Thank you / merci.

[09/04/16 00:21:13] [SSH] Opening SSH connection to slave01:22.
[09/04/16 00:21:13] [SSH] Authentication successful.
java.io.IOException: The execute request failed.
	at com.trilead.ssh2.channel.ChannelManager.requestExecCommand(ChannelManager.java:774)
	at com.trilead.ssh2.Session.execCommand(Session.java:306)
	at com.trilead.ssh2.Connection.exec(Connection.java:1553)
	at hudson.plugins.sshslaves.SSHLauncher.verifyNoHeaderJunk(SSHLauncher.java:872)
	at hudson.plugins.sshslaves.SSHLauncher.access$100(SSHLauncher.java:137)
	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:713)
	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:706)
	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 java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: This SSH2 channel is not open. state: 4
	at com.trilead.ssh2.channel.ChannelManager.ioException(ChannelManager.java:1543)
	at com.trilead.ssh2.channel.ChannelManager.waitForChannelRequestResult(ChannelManager.java:167)
	at com.trilead.ssh2.channel.ChannelManager.requestExecCommand(ChannelManager.java:769)
	... 10 more
Caused by: java.io.IOException: The connection is being shutdown
	at com.trilead.ssh2.channel.ChannelManager.handleEndMessage(ChannelManager.java:1525)
	at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:522)
	... 1 more
Caused by: java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(Unknown Source)
	at java.net.SocketInputStream.read(Unknown Source)
	at com.trilead.ssh2.crypto.cipher.CipherInputStream.fill_buffer(CipherInputStream.java:41)
	at com.trilead.ssh2.crypto.cipher.CipherInputStream.internal_read(CipherInputStream.java:52)
	at com.trilead.ssh2.crypto.cipher.CipherInputStream.getBlock(CipherInputStream.java:79)
	at com.trilead.ssh2.crypto.cipher.CipherInputStream.read(CipherInputStream.java:108)
	at com.trilead.ssh2.transport.TransportConnection.receiveMessage(TransportConnection.java:232)
	at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:693)
	at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:489)
	... 1 more
[09/04/16 00:21:13] Launch failed - cleaning up connection
[09/04/16 00:21:13] [SSH] Connection closed.
Message has been deleted

KY L

unread,
Sep 27, 2016, 6:13:14 PM9/27/16
to Jenkins Users
I have the exact error on my Jenkins 2.7.4 server connecting to Windows Server 2012 R2 with OpenSSH-Win64 with public key only authentication.
I have successfully tested connection to other Windows machines with the exact version of OpenSSH-Win64 with public key only authentication, which gave me a CMD prompt.

Settings changed in sshd_config are:
PubkeyAuthentication yes
PasswordAuthentication no

I installed openssh via:
choco install win32-openssh -y

Then i tried the x86 version of the same OpenSSH, and yet the error was the same.

According to this post: https://wiki.jenkins-ci.org/display/JENKINS/SSH+slaves+and+Cygwin

Cygwin comes with OpenSSH server, which works well with SSH Slaves plugin. This is one of the recommended way of controlling Windows slaves from Jenkins, if you don't mind the added effort of installing Cygwin and sshd.


I have yet to succeed, but i will post back soon.

KY L

unread,
Oct 7, 2016, 3:57:37 PM10/7/16
to Jenkins Users
I tried even MingW SSH server without avail. I have put this on hold to focus on other things. Will try again when the time is more relaxed. Good luck.
Reply all
Reply to author
Forward
0 new messages