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… Could not copy remoting.jar into ‘/var/lib/jenkins’ on agent
at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(
at hudson.plugins.sshslaves.SSHLauncher.access$300(
at hudson.plugins.sshslaves.SSHLauncher$
at hudson.plugins.sshslaves.SSHLauncher$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
Caused by: java.lang.IllegalArgumentException: invalid len argument
at com.trilead.ssh2.jenkins.SFTPClient$
at hudson.plugins.sshslaves.SSHLauncher.readInputStreamIntoByteArrayAndClose(
at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(

can you help me?


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