Vladimir Voitekhovski
Vladimir Voitekhovski

Reputation: 1602

Jenkins node connection troubles

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

Upvotes: 27

Views: 34365

Answers (5)

Sumukh Bhandarkar
Sumukh Bhandarkar

Reputation: 384

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

Upvotes: 0

santosh verma
santosh verma

Reputation: 294

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.

Upvotes: 1

user3895254
user3895254

Reputation: 496

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

Upvotes: 48

SkipKent
SkipKent

Reputation: 457

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.

Upvotes: 2

dreamzor
dreamzor

Reputation: 5925

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.

Upvotes: 2

Related Questions