【问题标题】:Ubuntu Slave Node (Jenkins) ErrorUbuntu 从节点 (Jenkins) 错误
【发布时间】:2017-02-15 11:04:35
【问题描述】:

我最近在开发 Jenkins 环境中设置了一个 RHEL7 从节点,它只是通过 SSH 运行了一些 Unix 特定的脚本。

是时候在我的公司生产环境中基本上复制这个了(使用不同的从节点(Ubuntu 16.04),我已经从 Dev jenkins 复制了从节点配置,并一直在解决日志产生的错误,但是我在这个阶段被困了一段时间,找不到任何与我的情况相关的文档。

我收到以下错误:

    [02/15/17 10:47:11] [SSH] Starting slave process: cd "/home/jenkins" && java  -jar slave.jar
Exception in thread "main" java.lang.RuntimeException: Root directory not writable
    at hudson.remoting.FileSystemJarCache.<init>(FileSystemJarCache.java:44)
    at hudson.remoting.Launcher.runWithStdinStdout(Launcher.java:477)
    at hudson.remoting.Launcher.run(Launcher.java:251)
    at hudson.remoting.Launcher.main(Launcher.java:201)
hudson.util.IOException2: Slave JVM has terminated. Exit code=1
    at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:984)
    at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:137)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:725)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:706)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException: unexpected stream termination
    at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:365)
    at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:310)
    at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:389)
    at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:976)
    ... 7 more
[02/15/17 10:47:11] Launch failed - cleaning up connection
[02/15/17 10:47:11] [SSH] Connection closed.

我对根目录 (home/jenkins/jenkins_slave) 的权限进行了两次、三次检查,它们都很好。如果我尝试在从节点上手动运行 java -jar slave.jar 我会收到以下错误:

WARNING: Are you running slave agent from an interactive console?
If so, you are probably using it incorrectly.
See http://wiki.jenkins ci.org/display/JENKINS/Launching+slave.jar+from+from+console
<===[JENKINS REMOTING CAPACITY]===>

我只是不明白,因为权限和配置是相同的,所以它必须是环境的东西?任何帮助/指导将不胜感激。

【问题讨论】:

  • 尝试使用getenforce 命令检查 SELinux(如果已安装)的状态。企业形象可能有一些限制性政策。如果您得到Enforcing 作为命令的返回,请参阅 SELinux 文档和公司政策以进行进一步研究。命令ausearch -i 将帮助您证明在这种情况下某些访问是被禁止的。
  • 嗨 @doz10us 感谢您的回复 - 我检查了 SELinux 的状态却发现它甚至没有安装哈哈。
  • 有人可以帮忙吗?

标签: java ubuntu jenkins slave


【解决方案1】:

你的家不是/home/jenkins/jenkins_slave,而是home/jenkins——至少根据你提供的日志输出(Starting slave process: cd "/home/jenkins" [...])。所以你应该把slave的启动配置和cd改成/home/jenkins/jenkins_slave

【讨论】:

    猜你喜欢
    • 2017-10-05
    • 1970-01-01
    • 1970-01-01
    • 2017-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多