在詹金斯获得hudson.remoting.ChannelClosedException

时间:2019-09-10 18:13:43

标签: jenkins groovy

在我公司,我们使用CommandLauncher类来连接从站。我们使用CommandLauncher launcher = new CommandLauncher("/var/jenkins_home/workspace/Infra/build-scripts/launch-slave.sh $ip")运行了连接脚本,它就像魔术一样工作。

自从我们升级了Jenkins之后,现在我们必须使用脚本批准,所以不能以这种方式使用它,因为我们不想每次加入新节点时都进行批准。因此,我们将IP作为环境变量进行传递,因此脚本无需任何批准即可运行,如下所示:

CommandLauncher launcher = new CommandLauncher(
      "/var/jenkins_home/workspace/Infra/build-scripts/launch-slave.sh",
      new EnvVars("NODE_IP", ip)
  )

launch-slave.sh所做的相同,只是使用IP作为环境变量。重要的是要了解脚本完全相同。

自那时以来,我们遇到了hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on 192.168.148.202 failed. The channel is closing down or has closed down从未发生过的错误,我们确信是因为我们将脚本改回了而看不到。仅当从EnvVars获取IP时,我们才能进行此操作,我们不了解此微小更改如何导致断开连接。

0 个答案:

没有答案