Jenkins node connection troubles

自作多情 提交于 2019-12-12 07:31:04

问题


Hi i have got the following error but my node is up and in jenkins logs everything is ok but on some of my jobs which are going on the nodes i've got the following trouble

12:59:29 [EnvInject] - Loading node environment variables.
12:59:29 ERROR: SEVERE ERROR occurs
12:59:29 org.jenkinsci.lib.envinject.EnvInjectException: hudson.remoting.ChannelClosedException: channel is    already closed
12:59:29    at org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvironmentVariablesNode(EnvironmentVariablesNodeLoader.java:75)
12:59:29    at org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:81)
12:59:29    at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:39)
12:59:29    at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:637)
12:59:29    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:543)
12:59:29    at hudson.model.Run.execute(Run.java:1676)
12:59:29    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
12:59:29    at hudson.model.ResourceController.execute(ResourceController.java:88)
12:59:29    at hudson.model.Executor.run(Executor.java:231)
12:59:29 Caused by: hudson.remoting.ChannelClosedException: channel is already closed
12:59:29    at hudson.remoting.Channel.send(Channel.java:524)
12:59:29    at hudson.remoting.Request.call(Request.java:129)
12:59:29    at hudson.remoting.Channel.call(Channel.java:722)
12:59:29    at hudson.FilePath.act(FilePath.java:1003)
12:59:29    at org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvironmentVariablesNode(EnvironmentVariablesNodeLoader.java:44)
 12:59:29   ... 8 more
12:59:29 Caused by: java.io.IOException
12:59:29    at hudson.remoting.Channel.close(Channel.java:1007)
12:59:29    at hudson.slaves.ChannelPinger$1.onDead(ChannelPinger.java:110)
12:59:29    at hudson.remoting.PingThread.ping(PingThread.java:120)
12:59:29    at hudson.remoting.PingThread.run(PingThread.java:81)
12:59:29 Caused by: java.util.concurrent.TimeoutException: Ping started on 1401694124050 hasn't completed at 1401694364050
12:59:29    ... 2 more
12:59:29 Archiving artifacts
12:59:29 Email was triggered for: Failure
12:59:29 Sending email for trigger: Failure
12:59:29 ERROR: Error: No workspace found!
12:59:29 Error retrieving environment vars: channel is already closed
12:59:29 Sending email to: $EMAIL_USERS
12:59:49 Error sending to the following INVALID addresses: $EMAIL_USERS
12:59:49 [EnvInject] - [ERROR] - SEVERE ERROR occurs: channel is already closed

 12:59:49 Finished: FAILURE

回答1:


I don't know the reason but it happens after a restart of the slave machine or when the machine lost the connection (during a long period).

The problem (in my case) was that the process java -jar slave.jar was not running in the slave. For solve it, try to reconnect the node in Jenkins menus, so go to:

Manage Jenkins -> Manage Nodes -> YOUR_NODE -> Disconnect

Manage Jenkins -> Manage Nodes -> YOUR_NODE -> Launch slave agent




回答2:


It may also happen if you don't have a configured DNS and slave's IP address has suddenly changed between jobs. Disconnecting/relaunching slave agent with proper IP address also helps.




回答3:


This worked for me:

  1. Make sure Jenkins node service is running
  2. Go to node-specific page on Jenkins and click 'Disconnect'

In my case it re-connected automagically and I was all set from there.




回答4:


In my case, Jenkins slave was hang. I was unable to ssh and check. Although slave node was showing online. But unable to connect when try to disconnect and re-connect.

In my case, I have rebooted my slave node, then it's work fine.




回答5:


Clean the workspace. Many saved and cached content can cause such an error



来源:https://stackoverflow.com/questions/23991977/jenkins-node-connection-troubles

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!