# TestExecute Job using Jenkins on Azure VM - Closed Channel Exception

**URL:** <https://community.jenkins.io/t/testexecute-job-using-jenkins-on-azure-vm-closed-channel-exception/5843>\
**Category:** Using Jenkins\
**Tags:** question\
**Created:** [February 17, 2023, 5:57pm UTC](https://community.jenkins.io/t/testexecute-job-using-jenkins-on-azure-vm-closed-channel-exception/5843 "2023-02-17T17:57:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mailtorakesh09](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mailtorakesh09](https://community.jenkins.io/u/mailtorakesh09)\
**Post date:** [February 17, 2023, 5:57pm UTC](https://community.jenkins.io/t/testexecute-job-using-jenkins-on-azure-vm-closed-channel-exception/5843/1 "2023-02-17T17:57:32Z")

</div>

I am running a TestExecute job from Jenkins interface on a Azure VM. I noticed that I am getting ClosedChannelException multiple times. Below are a sample error logs:

Started by user Admin  
Running as SYSTEM  
[EnvInject] - Loading node environment variables.  
FATAL: java.nio.channels.ClosedChannelException  
java.nio.channels.ClosedChannelException  
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 4.224.61.58/4.224.61.58:54323  
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)  
at hudson.remoting.Request.call(Request.java:199)  
at hudson.remoting.Channel.call(Channel.java:999)  
at hudson.FilePath.act(FilePath.java:1277)  
at org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvVarsForNode(EnvironmentVariablesNodeLoader.java:61)  
at org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:78)  
at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:42)  
at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:617)  
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485)  
at hudson.model.Run.execute(Run.java:1900)  
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)  
at hudson.model.ResourceController.execute(ResourceController.java:107)  
at hudson.model.Executor.run(Executor.java:449)  
Caused: hudson.remoting.RequestAbortedException  
at hudson.remoting.Request.abort(Request.java:346)  
at hudson.remoting.Channel.terminate(Channel.java:1080)  
at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:241)  
at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:221)  
at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:825)  
at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:289)  
at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:168)  
at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:825)  
at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:155)  
at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:180)  
at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:789)  
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:30)  
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:70)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)  
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)  
at java.base/java.lang.Thread.run(Thread.java:834)  
Finished: FAILURE

Can someone help me out here?

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [March 6, 2023, 9:13am UTC](https://community.jenkins.io/t/testexecute-job-using-jenkins-on-azure-vm-closed-channel-exception/5843/2 "2023-03-06T09:13:42Z")

</div>

Hello @mailtorakesh09 and welcome to this community 👋

The `ClosedChannelException` is thrown when a channel is closed before an operation is completed. In the context of Jenkins, this usually indicates an issue with the communication between the master and agent nodes.

There are a few things you can try to resolve this issue:

1. Check the connectivity between the master and agent nodes. Make sure that the agent node is reachable and there are no network issues.
2. Restart the Jenkins master and agent nodes to see if the issue resolves.
3. Upgrade the Jenkins version to the latest stable release.
4. Check if the Jenkins plugin versions used in the job are compatible with the Jenkins version. You can also try updating the plugin versions to the latest available versions.
5. If none of the above solutions work, try launching the agent node using a different launcher, such as the SSH launcher.
6. As you are using the Azure cloud provider, check if there are any firewalls or security groups blocking the communication between the Jenkins master and agent nodes.
