简体   繁体   中英

Configuration of a slave node in Jenkins with SSH agent

I have this error when I try to configure a slave node in Jenkins with SSH agent. How can I resolve this?

[11/07/17 13:13:05] [SSH] Checking java version of java
[11/07/17 13:13:05] [SSH] java -version returned 1.8.0_151.
[11/07/17 13:13:05] [SSH] Starting sftp client.
[11/07/17 13:13:05] [SSH] Remote file system root /home/Jenkins does not exist. Will try to create it...
java.io.IOException: Could not copy slave.jar into '/home/Jenkins' on slave
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJar(SSHLauncher.java:1152)
    at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:145)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:816)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:793)
    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.io.IOException: Failed to mkdir /home/Jenkins
    at hudson.plugins.sshslaves.SFTPClient.mkdirs(SFTPClient.java:83)
    at hudson.plugins.sshslaves.SSHLauncher.copySlaveJar(SSHLauncher.java:1120)
    ... 7 more
Caused by: com.trilead.ssh2.SFTPException: Permission denied (SSH_FX_PERMISSION_DENIED: The user does not have sufficient permissions to perform the operation.)
    at com.trilead.ssh2.SFTPv3Client.expectStatusOKMessage(SFTPv3Client.java:555)
    at com.trilead.ssh2.SFTPv3Client.mkdir(SFTPv3Client.java:955)
    at hudson.plugins.sshslaves.SFTPClient.mkdirs(SFTPClient.java:81)
    ... 8 more
[11/07/17 13:13:05] Launch failed - cleaning up connection
[11/07/17 13:13:05] [SSH] Connection closed.

It looks like you haven't set up the home directory for the user that you logged in as over ssh, and the /home directory is locked down so that user cannot create it (as it should be). You probably just need to create /home/jenkins on the slave machine with the appropriate permissions for the user running slave.jar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM