Error with comunication between master jenkins and jenkins nodes

Hi, I updraged my Jenkins master to version 2.325 ans now when I reboot my jenkins nodes they doesnt reconnect with the master, ans when I reconect the node from the master, it tells a error copying file remoting.jar, and if I remove this file in the node then I can reconnect the node, any permission was change in any folder in the master and nodes machines, then I dont understand why appear this error now when in the previous jenkins version it works fine,

The log to connect with node:

[01/20/22 12:11:22] [SSH] Checking java version of /usr/lib/jvm/java-1.8.0-openjdk/bin/java
[01/20/22 12:11:22] [SSH] /usr/lib/jvm/java-1.8.0-openjdk/bin/java -version returned 1.8.0_302.
[01/20/22 12:11:22] [SSH] Starting sftp client.
[01/20/22 12:11:22] [SSH] Copying latest remoting.jar…
java.io.IOException: Could not copy remoting.jar into ‘/var/lib/jenkins’ on agent
at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:717)
at hudson.plugins.sshslaves.SSHLauncher.access$300(SSHLauncher.java:113)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:457)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:423)
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.lang.IllegalArgumentException: invalid len argument
at com.trilead.ssh2.SFTPv3Client.read(SFTPv3Client.java:1232)
at com.trilead.ssh2.jenkins.SFTPClient$SFTPInputStream.read(SFTPClient.java:172)
at com.google.common.io.ByteStreams.toByteArrayInternal(ByteStreams.java:184)
at com.google.common.io.ByteStreams.toByteArray(ByteStreams.java:224)
at hudson.plugins.sshslaves.SSHLauncher.readInputStreamIntoByteArrayAndClose(SSHLauncher.java:775)
at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:686)

can you help me?

Thanks.

1 Like

Is /var,/lib/Jenkins not writable by the user you connected as?

yes, the user jenkins can write, it is confirmed because if I execute this command from master to the node, remoting.jar file is overwritten in the node.

scp remoting.jar jenkins@x.x.x.x:/var/lib/jenkins

The permissions of jenkins folder are:

drwx------ 23 jenkins jenkins 4.0K Jan 21 06:57 jenkins

Hi, anyone know what could be the issue? Thanks

I am also experiencing this issue. Any one has a fix for this one ? Appreciate your help.

open an issue on https://issues.jenkins.io
there’s no new info to help diagnose this. Try to include what version of jenkins, what os, what the drive is formatted as. What the login shell is. etc

Thanks Gavin. I found the solution here :: [JENKINS-67258] Could not copy remoting.jar - Jenkins Jira.
upgrading SSH Build Agents / SSH Slaves Plugin to version 1.32.0 and beyond helps with resolving this problem

I have not performed the upgrades, or applied the migration change to “Controller” terminology.

Instead what resolved the problem for me was (on the agent):
mv /var/lib/jenkins/remoting.jar /var/lib/jenkins/remoting.jar-RENAMED

I did not expect that to actually work, because I saw no ownership or permission issues on the file, or on the parent directory. But it worked. FYI if you are not ready to update the system.