Unable to start jenkins agent
Asked Answered
C

1

5

When i try to start my Jenkins agent, the agent exits with error:

[04/14/17 17:22:06] [SSH] Checking java version of java
[04/14/17 17:22:06] [SSH] java -version returned 1.7.0_121.
[04/14/17 17:22:06] [SSH] Starting sftp client.
[04/14/17 17:22:06] [SSH] Copying latest slave.jar...
[04/14/17 17:22:06] [SSH] Copied 719,269 bytes.
Expanded the channel window size to 4MB
[04/14/17 17:22:06] [SSH] Starting slave process: cd "/home/jenkins" && java     -jar slave.jar -text
<===[JENKINS REMOTING CAPACITY]===><===[HUDSON TRANSMISSION BEGINS]===channel started
Slave JVM has not reported exit code. Is it still running?
[04/14/17 17:22:11] Launch failed - cleaning up connection
ERROR: Connection terminated
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2625)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3100)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:854)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:350)
at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:59)
Caused: java.io.IOException: Unexpected termination of the channel
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:73)
[04/14/17 17:22:11] [SSH] Connection closed.

Is there anyway to fix this? I've googled, and googled, and googled, but can't find anything to solve this problem.

Calends answered 14/4, 2017 at 15:26 Comment(0)
M
7

I haven't faced the same issue, but I guess it may be linked to this: https://issues.jenkins-ci.org/browse/JENKINS-27624

(It is in case your Jenkins version is 2.54 - minimum java version should be 8)

Mylan answered 15/4, 2017 at 7:17 Comment(4)
Thanks Olia. This was indeed the problem. Jenkins should implement a nice error message when having older Java versions :(.Calends
You are welcome, @Calends :) I agree with you, since very often it is quite difficult to find out the root of the problem with Jenkins. I came to conclusion that the best thing in such a situation is to check issues.jenkins-ci.org for any suspected problems in each bad caseMylan
Boy, we just ran into this ourselves. I would have loved an explicit error. The very first line of that output makes you think that the Java version check worked without issue: "Checking java version of java"...Formation
Same issue here, just updated to the latest Jenkins version and all the linux slaves failing. As Taytay said, you think the version check would be doing something.Jello

© 2022 - 2024 — McMap. All rights reserved.