简体   繁体   English

Jenkins无头Linux奴隶连接错误

[英]Jenkins headless linux slave connection error

I get java.net.SocketException: Connection reset when trying to connect a headless debian slave to my main Jenkins master. 我得到java.net.SocketException:尝试将无头Debian从属服务器连接到我的主要Jenkins主服务器时,连接重置。 It's been running good for a couple of weeks without error and suddenly I can't get it to connect. 它运行了好几个星期没有出现错误,突然之间我无法连接它。

I can telnet into the master on port 6256. 我可以通过端口6256远程登录到主服务器。

Slave output: 从站输出:

#> java -jar ~/slave.jar -jnlpUrl https://test.tv/jenkins/computer/debian_slave_node_1/slave-agent.jnlp
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Hudson agent is running in headless mode.
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://test.tv/jenkins/, http://test.tv/jenkins/]
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to test.tv:6256
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: Connection reset
java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:189)
    at java.net.SocketInputStream.read(SocketInputStream.java:121)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
    at hudson.remoting.ClassicCommandTransport.create(ClassicCommandTransport.java:98)
    at hudson.remoting.Channel.<init>(Channel.java:391)
    at hudson.remoting.Channel.<init>(Channel.java:387)
    at hudson.remoting.Channel.<init>(Channel.java:348)
    at hudson.remoting.Channel.<init>(Channel.java:344)
    at hudson.remoting.Channel.<init>(Channel.java:332)
    at hudson.remoting.Engine.run(Engine.java:238)

Jenkins Master output: Jenkins Master的输出:

java.io.IOException: Unexpected termination of the channel
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)
Caused by: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at hudson.remoting.Command.readFrom(Command.java:92)
at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:72)
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)

Hard to say what happens before knowing more. 在知道更多之前很难说会发生什么。 In particular: 尤其是:

  • does it fail at every connection request ? 每个连接请求都会失败吗? If so please check your auth.log on your server as it seems the failure happens after "status INFO: Handshaking" and before "Connected" 如果是这样,请检查服务器上的auth.log,因为故障似乎发生在“状态信息:握手”之后和“已连接”之前
  • are your clock properly synchronized ? 您的时钟正确同步了吗?
  • what OSes are you using ? 您正在使用什么操作系统? Which java version on your slaves ? 您的奴隶上有哪个Java版本? check your PATH and JAVA_HOME 检查您的PATH和JAVA_HOME
  • have you updated jenkins lately ? 你最近更新詹金斯吗? If so, have you updated the slave(s) ? 如果是这样,您是否更新了从站? Also have you tried reverting the update ? 您是否也尝试过还原更新? Which version are you using ? 您正在使用哪个版本? 1.520 took out support for JDK 1.5. 1.520取消了对JDK 1.5的支持。
  • how do you run your java command ? 您如何运行Java命令? From a terminal in an SSH session ? 从SSH会话中的终端? Is this scripted from the master ? 这是主人写的吗?

See also Jenkins slave jobs failing on "Unexpected termination of channel" 另请参见Jenkins从属作业在“意外终止通道”时失败

I've run into the same issue, which seemed to be worked-around by running jenkins-slave as root. 我遇到了同样的问题,似乎可以通过以root身份运行jenkins-slave来解决。 Now, the thing periodically disconnects with that very same error, which I'm wondering is due to a LB keepalive. 现在,该事件会定期以相同的错误断开连接,我想知道这是由于LB keepalive引起的。 I'll update this answer as soon as I get more info. 我将在获得更多信息后立即更新此答案。

In my case everything was working under root account. 就我而言,一切都在root帐户下进行。 But under user account, node client failed to connect to server with message "failed Unexpected termination of the channel". 但是在用户帐户下,节点客户端无法通过消息“失败的通道意外终止”连接到服务器。 The problem was with access-or-write to working folder. 问题在于访问或写入工作文件夹。 As soon as I've reassigned owner throug "chown -R", node starts successfully. 通过“ chown -R”重新分配所有者后,节点将成功启动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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