Windows client ssh connection error

43 views
Skip to first unread message

Jérôme Godbout

unread,
Sep 1, 2020, 11:48:39 AM9/1/20
to jenkins...@googlegroups.com

Hi,

 

I did solve my issue with the ssh agent I had earlier, but when I try to do the same on another Windows client machine I get this weird error below. The log on the slave are empty (c:\JenkinsSlave\remoting). The error is a bit vague and I have no clue what is wrong. I can connect with ssh, I also did it on the master node to approve the address to ensure it was not an issue. Seem like the exchange stream are breaking down!?! what is going on?

 

[09/01/20 11:33:18] [SSH] Checking java version of C:\Java\1_8_0_261\/bin/java

[09/01/20 11:33:19] [SSH] C:\Java\1_8_0_261\/bin/java -version returned 1.8.0_261.

[09/01/20 11:33:19] [SSH] Starting sftp client.

[09/01/20 11:33:19] [SSH] Copying latest remoting.jar...

Source agent hash is E5FEC468D6F172BF394E1F2571EA686C. Installed agent hash is E5FEC468D6F172BF394E1F2571EA686C

Verified agent jar. No update is necessary.

Expanded the channel window size to 4MB

[09/01/20 11:33:35] [SSH] Starting agent process: cd "c:\JenkinsSlave" && C:\Java\1_8_0_261\/bin/java  -jar remoting.jar -workDir c:\JenkinsSlave -jar-cache c:\JenkinsSlave/remoting/jarCache

<===[JENKINS REMOTING CAPACITY]===>Sep 01, 2020 11:33:35 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir

INFO: Using c:\JenkinsSlave\remoting as a remoting work directory

Sep 01, 2020 11:33:35 AM org.jenkinsci.remoting.engine.WorkDirManager setupLogging

INFO: Both error and output logs will be printed to c:\JenkinsSlave\remoting

<===[JENKINS REMOTING CAPACITY]===>Exception in thread "main" java.io.EOFException: unexpected stream termination

        at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:415)

        at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:360)

        at hudson.remoting.Launcher.main(Launcher.java:770)

        at hudson.remoting.Launcher.runWithStdinStdout(Launcher.java:718)

        at hudson.remoting.Launcher.run(Launcher.java:398)

        at hudson.remoting.Launcher.main(Launcher.java:298)

ERROR: ERROR: Connection terminated

java.io.IOException: Unexpected termination of the channel

java.io.EOFException

        at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2681)

        at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3156)

        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)

        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358)

        at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)

        at hudson.remoting.Command.readFrom(Command.java:142)

        at hudson.remoting.Command.readFrom(Command.java:128)

        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)

hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected termination of the channel

        at hudson.remoting.Request.abort(Request.java:340)

        at hudson.remoting.Channel.terminate(Channel.java:1081)

        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:94)

        Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to KeilDellGris

               at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)

               at hudson.remoting.Request.call(Request.java:202)

               at hudson.remoting.Channel.call(Channel.java:997)

               at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:642)

               at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:424)

               at hudson.plugins.sshslaves.SSHLauncher.startAgent(SSHLauncher.java:623)

               at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:112)

               at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:457)

               at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:422)

               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

        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)

Caused by: java.io.EOFException

        at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2681)

        at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3156)

        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)

        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358)

        at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)

        at hudson.remoting.Command.readFrom(Command.java:142)

        at hudson.remoting.Command.readFrom(Command.java:128)

        at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)

        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)

[09/01/20 11:33:37] Launch failed - cleaning up connection

[09/01/20 11:33:37] [SSH] Connection closed.

 

Ivan Fernandez Calvo

unread,
Sep 1, 2020, 12:04:53 PM9/1/20
to Jenkins Users
Has the user that connect permissions on c:\JenkinsSlave? Is the folder c:\JenkinsSlave\remoting created? Are there some err_pid* files or log files in c:\JenkinsSlave folder?

Ivan Fernandez Calvo

unread,
Sep 1, 2020, 12:19:44 PM9/1/20
to Jenkins Users
when you enter on that Windows machine though SSH manually, Do you have a long banner at the beginning that you do not have in the other machine?

Jérôme Godbout

unread,
Sep 1, 2020, 12:36:55 PM9/1/20
to jenkins...@googlegroups.com

No nothing

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1af4931f-cd2f-4688-8925-df4c194d6f8fn%40googlegroups.com.

Jérôme Godbout

unread,
Sep 1, 2020, 12:39:56 PM9/1/20
to jenkins...@googlegroups.com

Yes, I created the folder and give the user (I made a local user for this called Jenkins). The user has full control over that folder. Does it require the user to be admin?

The following are created:

c:\JenkinsSlave\

                remoting.jar

                remoting\

                                jarCache\

                                                (empty)

                                logs\

                                                remoting.log.0

                                                …

                                                remoting.log.4 (all 0 kb file empty)

 

From: jenkins...@googlegroups.com <jenkins...@googlegroups.com> On Behalf Of Ivan Fernandez Calvo
Sent: September 1, 2020 12:05 PM
To: Jenkins Users <jenkins...@googlegroups.com>
Subject: Re: Windows client ssh connection error

 

Has the user that connect permissions on c:\JenkinsSlave? Is the folder c:\JenkinsSlave\remoting created? Are there some err_pid* files or log files in c:\JenkinsSlave folder?

--

You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Jérôme Godbout

unread,
Sep 1, 2020, 2:05:19 PM9/1/20
to jenkins...@googlegroups.com

Hi,

 

Is there any special requirements? (ssh does work from both Linux and Windows to this machine, also from the Jenkins master user account too). Seem like starting the slave fails, anything to do with firewall or something like that?

 

here the node that work (Windows 10 64 bits):

[09/01/20 09:26:41] [SSH] Checking java version of C:\Java\jdk1.8.0_261\/bin/java

[09/01/20 09:26:42] [SSH] C:\Java\jdk1.8.0_261\/bin/java -version returned 1.8.0_261.

[09/01/20 09:26:42] [SSH] Starting sftp client.

[09/01/20 09:26:42] [SSH] Copying latest remoting.jar...

Source agent hash is E5FEC468D6F172BF394E1F2571EA686C. Installed agent hash is E5FEC468D6F172BF394E1F2571EA686C

Verified agent jar. No update is necessary.

Expanded the channel window size to 4MB

[09/01/20 09:26:55] [SSH] Starting agent process: cd "c:\JenkinsSlave" && C:\Java\jdk1.8.0_261\/bin/java  -jar remoting.jar -workDir c:\JenkinsSlave -jar-cache c:\JenkinsSlave/remoting/jarCache

Sep 01, 2020 9:26:56 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir

INFO: Using c:\JenkinsSlave\remoting as a remoting work directory

Sep 01, 2020 9:26:57 AM org.jenkinsci.remoting.engine.WorkDirManager setupLogging

INFO: Both error and output logs will be printed to c:\JenkinsSlave\remoting

<===[JENKINS REMOTING CAPACITY]===>channel started

Remoting version: 4.3

This is a Windows agent

Sep 01, 2020 9:27:00 AM com.youdevise.hudson.slavestatus.SlaveListener call

INFO: Slave-status listener starting

Sep 01, 2020 9:27:00 AM com.youdevise.hudson.slavestatus.SocketHTTPListener waitForConnection

INFO: Slave-status listener ready on port 3141

[StartupTrigger] - Scanning jobs for node WindowsJG

Agent successfully connected and online

 

 

The one that doesn’t work (Windows 10 64 bits also, using the same Java jdk version):

[09/01/20 14:00:16] [SSH] Checking java version of C:\Java\1_8_0_261\/bin/java
[09/01/20 14:00:16] [SSH] C:\Java\1_8_0_261\/bin/java -version returned 1.8.0_261.
[09/01/20 14:00:16] [SSH] Starting sftp client.
[09/01/20 14:00:16] [SSH] Copying latest remoting.jar...
[09/01/20 14:00:19] [SSH] Copied 1,522,833 bytes.
Expanded the channel window size to 4MB
[09/01/20 14:00:19] [SSH] Starting agent process: cd "c:\JenkinsSlave" && C:\Java\1_8_0_261\/bin/java  -jar remoting.jar -workDir c:\JenkinsSlave -jar-cache c:\JenkinsSlave/remoting/jarCache
<===[JENKINS REMOTING CAPACITY]===>Sep 01, 2020 2:00:19 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using c:\JenkinsSlave\remoting as a remoting work directory
Sep 01, 2020 2:00:19 PM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
INFO: Both error and output logs will be printed to c:\JenkinsSlave\remoting
<===[JENKINS REMOTING CAPACITY]===>ERROR: Connection terminated
ERROR: java.io.IOException: Unexpected termination of the channel
[09/01/20 14:00:21] Launch failed - cleaning up connection
[09/01/20 14:00:21] [SSH] Connection closed.

Jérôme Godbout

unread,
Sep 1, 2020, 2:12:42 PM9/1/20
to jenkins...@googlegroups.com

Did try without the firewall and it doesn’t work either, !?!? Anyone got an idea what it is actually doing that might not work?!? Both machine are on the same network, no ip conflict. If I delete the remoting.jar and the folders into c:\JenkinsSlave it get created again, so the connection is happening and it can transfer the file.

Jérôme Godbout

unread,
Sep 1, 2020, 2:26:20 PM9/1/20
to jenkins...@googlegroups.com

Ivan Fernandez Calvo

unread,
Sep 1, 2020, 3:17:04 PM9/1/20
to Jenkins Users
>Does it require the user to be admin?

no, a regular user should work if has access to the workdir 

>Maybe this unresolved issue is still there!?

this issue has a different stack trace and fails in another place. 

The issue here happens after the SSH connection when the remoting process tries to read from the stdin, there is nothing to read, and the remoting process exits. 

Do you have an antivirus enabled in that machine?

Did you check the SSHD service logs on your agent? try to increase the verbosity by setting LogLevel VERBOSE or LogLevel DEBUG1 on your /etc/ssh/sshd_config file and see Logging_and_Troubleshooting
Could you try to run the remoting commands manually from the Jenkins instance and see if the remoting process stars? 
ssh user@jenkins_agent "cd c:\JenkinsSlave && C:\Java\1_8_0_261\bin\java  -jar remoting.jar -workDir c:\JenkinsSlave -jar-cache c:\JenkinsSlave\remoting\jarCache"

Jérôme Godbout

unread,
Sep 1, 2020, 4:12:42 PM9/1/20
to jenkins...@googlegroups.com

Hi, for some obscure reason, the machine Window update were not totally up to date. Performing the all the update seem to have fix the issue. So it seem like old Windows 10 build aren’t working. Sorry for all the noise. Did try with and without the anti-virus, no difference. There was nothing meaningful into the master ssh.

 

Sorry could not test the manual ssh command since the machine was already into the process to perform the windows update…

 

Hope this help others, if they face the issue.

Reply all
Reply to author
Forward
0 new messages