jenkins节点ssh连接失败

时间:2018-10-11 09:53:10

标签: jenkins ssh

我尝试通过ssh将虚拟机(Windows 10)连接为jenkins中的节点。 但是在某些行之后会出现以下错误:

[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.

1 个答案:

答案 0 :(得分:0)

https://issues.jenkins-ci.org/browse/JENKINS-42856所述,这可能是一个已知问题。您能看到上述JENKINS错误中提到的以下变通办法是否有帮助?

我也有类似的问题,通道终止得太早了。我可以使用以下SSH前缀和后缀命令来规避它:

前缀:powershell-命令“ cd C:\ jenkins; java -jar slave.jar”;出口0;雷姆 后缀:“