gpt4 book ai didi

java - Jenkins windows ssh slave 访问被拒绝

转载 作者:行者123 更新时间:2023-12-05 07:53:59 24 4
gpt4 key购买 nike

我想在 Windows 机器上构建我的项目,所以我在那里创建了一个 slave。首先,我们尝试了标准的 Java 应用程序运行器,但我们的build设置了自己的环境,它总是以删除现有的 Java 安装而告终,没有给出任何正确的错误消息,但失败了。然后我切换到使用 Cygwin sshd 并让 Jenkins 通过 ssh 登录。这适用于连接(就像标准方法一样有效),但是当我运行构建时,它再次安装 jdk 失败。我最终手动运行了以下命令:

C:\jenkins\tools\hudson.model.JDK\Latest\jdk.exe ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=C:\jenkins\tools\hudson.model.JDK\Latest /L

这与 Jenkins 运行时相同,但没有/s(静默)选项。现在,当我运行构建时,出现以下错误:

    Building remotely on jenkins-slave-win64 (Johnny5) (windows) in workspace C:\jenkins\workspace\continuous.xill
java.io.IOException: remote file operation failed: C:\jenkins\tools\hudson.model.JDK\Latest at hudson.remoting.Channel@200354fa:jenkins-slave-win64 (Johnny5): java.nio.file.AccessDeniedException: C:\jenkins\tools\hudson.model.JDK\Latest\bin\java.exe
at hudson.FilePath.act(FilePath.java:987)
at hudson.FilePath.act(FilePath.java:969)
at hudson.FilePath.deleteRecursive(FilePath.java:1171)
at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:130)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:108)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
at hudson.model.JDK.forNode(JDK.java:132)
at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:360)
at hudson.model.Run.getEnvironment(Run.java:2234)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:935)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1036)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)
Caused by: java.nio.file.AccessDeniedException: C:\jenkins\tools\hudson.model.JDK\Latest\bin\java.exe
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at hudson.Util.deleteFile(Util.java:247)

当然,我什么都试过了:

以不同的(管理员)用户身份运行 sshd检查这里提到的每个错误:

这里

在这里

没有任何效果。你有提示去哪里看吗?

更新:

与此同时,我通过在 Jenkins 设置中停用“自动安装 jdk”选项,成功地在构建过程中取得了一些进展,git clone 工作并且 gradle 启动了。然而,现在 JAVA_HOME 环境变量不知何故无法被从机访问(尽管我们甚至尝试在 .bashrc 中设置它,只是为了确定)。因此构建失败并显示此消息“:

    FAILURE: Build failed with an exception.

* Where:
Script 'http://dl.bintray.com/content/shemnon/javafx-gradle/8.1.1/javafx.plugin' line: 60

* What went wrong:
A problem occurred evaluating script.
> Could not find JavaFX Packager Tools, please set one of [jfxrtDir in Gradle Properties, JFXRT_HOME in System Environment, JAVA_HOME in System Environment, java.home in JVM properties]

最佳答案

对于“UPDATE”后的构建错误,我认为您必须在 Manage Jenkins > Configure System > JDK 下添加 JDK 或在 Manage Jenkins > Global Tool Configuration > JDK 下添加 JDK

关于java - Jenkins windows ssh slave 访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31989098/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com