Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins node connection troubles

Tags:

jenkins

nodes

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 
like image 954
Vladimir Voitekhovski Avatar asked Jun 02 '14 10:06

Vladimir Voitekhovski


People also ask

Why Jenkins node is offline?

Jenkins monitors each attached node for disk space, free temp space, free swap, clock time/sync and response time. A node is taken offline if any of these values go outside the configured threshold.

What is the correct way to launch a Jenkins node?

In Jenkins, go to Manage Jenkins, then Manage Nodes, then click New Node. Here you can give your agent node a name, then select Permanent Agent and click OK. There are a variety of options you can use here to customize your node. All we care about right now is the Launch Method.


1 Answers

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

like image 191
user3895254 Avatar answered Nov 03 '22 21:11

user3895254