Pascal.S
Pascal.S

Reputation: 43

jenkins node ssh-connection fails

I try to connect a VM(Windows 10) as a node in jenkins with ssh. But after some lines occurs the following error:

[10/11/18 11:45:10] [SSH] Starting agent process: cd "C:\jenkins" && java  -jar remoting.jar -workDir C:\jenkins
<===[JENKINS REMOTING CAPACITY]===>Okt 11, 2018 11:45:11 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFORMATION: Using C:\jenkins\remoting as a remoting work directory
Both error and output logs will be printed to C:\jenkins\remoting
<===[JENKINS REMOTING CAPACITY]===>ERROR: Connection terminated
java.io.EOFException
    at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
    at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
    at java.io.ObjectInputStream.<init>(Unknown Source)
    at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)
    at hudson.remoting.Command.readFrom(Command.java:140)
    at hudson.remoting.Command.readFrom(Command.java:126)
    at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
    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)
Slave JVM has not reported exit code. Is it still running?
[10/11/18 11:45:17] Launch failed - cleaning up connection
[10/11/18 11:45:17] [SSH] Connection closed.

Upvotes: 1

Views: 1381

Answers (1)

ben5556
ben5556

Reputation: 3018

As noted on https://issues.jenkins-ci.org/browse/JENKINS-42856 this could be a known issue. Can you see if the below workaround mentioned on the above JENKINS bug helps ?

I have a similar problem with the channel being terminated too early. I was able to circumvent it using the following SSH prefix and postfix commands:

Prefix: powershell -Command "cd C:\jenkins ; java -jar slave.jar" ; exit 0 ; rem '

Postfix: '

Upvotes: 1

Related Questions