Issue
When you try to provisioning GCE agents after updating to CloudBees CI 2.361.1.1, the process fails and in the logs you find java.io.EOFException errors. The full trace should be similar to:
Launching Jenkins agent via plugin SSH: java -jar /tmp/agent.jar Sep 07, 2022 9:29:54 AM WARNING com.google.jenkins.plugins.computeengine.ComputeEngineCloud log Error: java.io.EOFException: unexpected stream termination at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:459) at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:404) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:437) at com.google.jenkins.plugins.computeengine.ComputeEngineComputerLauncher.launch(ComputeEngineComputerLauncher.java:316) at com.google.jenkins.plugins.computeengine.ComputeEngineComputerLauncher.launch(ComputeEngineComputerLauncher.java:224) at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:298) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:48) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:82) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
Resolution
The problem is due to the discrepancy in the JVM versions used by the controller and the agent. In the case where the trace was generated, the JVM version from the controller was Java 11, and the agents were using Java 8. They should use the same version. If you see a trace like shown above in this document, you should review the JVM version used in both.
Once the agent’s version matches the controller’s, the problem will be resolved.
This issue is being reported in controllers upgraded to version CloudBees CI 2.361.1.1 or higher as this version of the product uses now JDK 11, and the agents are required to use the same JVM as well.