报错信息一:
DG_RUNTIME_DIR=/run/user/0
XDG_SESSION_ID=2062
_=/etc/bashrc
[06/27/21 22:59:28] [SSH] Starting sftp client.
[06/27/21 22:59:28] [SSH] Remote file system root does not exist. Will try to create it...
java.io.IOException: Could not copy remoting.jar into '' on agent
at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:738)
at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:111)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:456)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:421)
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
at com.trilead.ssh2.jenkins.SFTPClient.mkdirs(SFTPClient.java:91)
at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:695)
... 7 more
Caused by: com.trilead.ssh2.SFTPException: No such file (SSH_FX_NO_SUCH_FILE: A reference was made to a file which does not exist.)
at com.trilead.ssh2.SFTPv3Client.expectStatusOKMessage(SFTPv3Client.java:555)
at com.trilead.ssh2.SFTPv3Client.mkdir(SFTPv3Client.java:955)
at com.trilead.ssh2.jenkins.SFTPClient.mkdirs(SFTPClient.java:89)
... 8 more
[06/27/21 22:59:28] Launch failed - cleaning up connection
[06/27/21 22:59:28] [SSH] Connection closed.
解决:
更改工作目录
报错信息二:
Checking Java version in the PATH
bash: java: command not found
Java is not in the PATH nor configured with the javaPath setting, Jenkins will try to guess where is Java, this guess will be removed in the future. :Launch agents via SSH
[06/27/21 23:20:22] [SSH] Checking java version of /tmp/jdk/bin/java
Couldn't figure out the Java version of /tmp/jdk/bin/java
bash: /tmp/jdk/bin/java: No such file or directory
[06/27/21 23:20:22] [SSH] Checking java version of java
Couldn't figure out the Java version of java
bash: java: command not found
[06/27/21 23:20:22] [SSH] Checking java version of /usr/bin/java
Couldn't figure out the Java version of /usr/bin/java
bash: /usr/bin/java: No such file or directory
[06/27/21 23:20:22] [SSH] Checking java version of /usr/java/default/bin/java
Couldn't figure out the Java version of /usr/java/default/bin/java
bash: /usr/java/default/bin/java: No such file or directory
[06/27/21 23:20:22] [SSH] Checking java version of /usr/java/latest/bin/java
Couldn't figure out the Java version of /usr/java/latest/bin/java
bash: /usr/java/latest/bin/java: No such file or directory
[06/27/21 23:20:22] [SSH] Checking java version of /usr/local/bin/java
Couldn't figure out the Java version of /usr/local/bin/java
bash: /usr/local/bin/java: No such file or directory
[06/27/21 23:20:22] [SSH] Checking java version of /usr/local/java/bin/java
Couldn't figure out the Java version of /usr/local/java/bin/java
bash: /usr/local/java/bin/java: No such file or directory
java.io.IOException: Java not found on hudson.slaves.SlaveComputer@384ad09b. Install Java 8 or Java 11 on the Agent.
at hudson.plugins.sshslaves.JavaVersionChecker.resolveJava(JavaVersionChecker.java:84)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:453)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:421)
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)
[06/27/21 23:20:22] Launch failed - cleaning up connection
[06/27/21 23:20:22] [SSH] Connection closed.
原因:
节点机器上没有安装java
报错信息三:
jenkins启动报Unsupported major.minor version 52.0