4
votes

When configuring an ssh slave on Jenkins, which runs on an ec2 instance, I get the following error message when I click on the "Launch Slave Agent".

[08/06/14 18:41:46] [SSH] Opening SSH connection to ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com:22.
[08/06/14 18:41:46] [SSH] Authentication successful.
[08/06/14 18:41:46] [SSH] The remote users environment is:
[08/06/14 18:41:46] [SSH] Starting sftp client.
[08/06/14 18:41:46] [SSH] SFTP failed. Copying via SCP.
[08/06/14 18:41:46] [SSH] Remote file system root /home/<user>/jenkins does not exist. Will try to create it...
Failed to create /home/<user>/jenkins
[08/06/14 18:41:46] [SSH] Copying latest slave.jar...
hudson.util.IOException2: Could not copy slave.jar into '/home/<user>/jenkins' on slave
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJarUsingSCP(SSHLauncher.java:967)
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJar(SSHLauncher.java:926)
    at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:596)
    at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:228)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Error during SCP transfer.
    at com.trilead.ssh2.SCPClient.put(SCPClient.java:523)
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJarUsingSCP(SSHLauncher.java:965)
    ... 7 more
Caused by: java.io.IOException: Remote scp terminated unexpectedly.
    at com.trilead.ssh2.SCPClient.readResponse(SCPClient.java:50)
    at com.trilead.ssh2.SCPClient.sendBytes(SCPClient.java:140)
    at com.trilead.ssh2.SCPClient.put(SCPClient.java:519)
    ... 8 more
[08/06/14 18:41:46] [SSH] Connection closed.

Jenkins configuration for this node is as follows :

Jenkins Config

Please note that I've set JavaPath property because Jenkins "Couldn't figure out the Java version of java" (that's the error message I was getting)

Any idea how I could fix this issue ? Thanks

2
replace the text <user> with something that actually exists?Petesh
What does <user> stands for? What do you expect using it?adolfosrs
in my case <user> stands for ec2-user, but it could be any user running the jenkins ssh slavePapelPincel
I am facing the same problem, did you get any solution @PapelPincel?rohitkadam19
@rohit_kadam sorry, I don't have access to the jenkins server anymore. I wish I could helpPapelPincel

2 Answers

1
votes

I have had same issue. After reading the following post talking about new version, realized something wrong on the SSH plugin that i'm using.

So I have visited to Manage plugins --> Installed --> searched 'SSH' (disabled SSH related clients by removing selection)
Basically you need:

  • Disabled - SSH Slaves plugin (probably comes with Jenkins)
  • Added SSH plugin (version 2.4).

Which resolved the issue, that i have had and successfully connected after other setups shown in this doc from step 6, JENKINS-SETTING UP MASTER SLAVE ENVIRONMENT. ( slave.jar -jnlpUrl....)
Hope this will help someone in future.

0
votes

You need to provide a valid path on the ec2 instance to which the user has an access.