# Windows Jenkins slaves are disconnecting and tunneling port stopped accepting requests

**URL:** <https://community.jenkins.io/t/windows-jenkins-slaves-are-disconnecting-and-tunneling-port-stopped-accepting-requests/7372>\
**Category:** Using Jenkins\
**Tags:** docker, windows\
**Created:** [May 14, 2023, 11:46am UTC](https://community.jenkins.io/t/windows-jenkins-slaves-are-disconnecting-and-tunneling-port-stopped-accepting-requests/7372 "2023-05-14T11:46:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@Ahmed](https://community.jenkins.io/u/Ahmed)\
**Post date:** [May 14, 2023, 11:46am UTC](https://community.jenkins.io/t/windows-jenkins-slaves-are-disconnecting-and-tunneling-port-stopped-accepting-requests/7372/1 "2023-05-14T11:46:15Z")

</div>

Hi, I’m using Jenkins which  
Jenkins version is JENKINS\_VERSION 2.375.2  
Java version is java.class.version 55.0  
https.protocols TLSv1.2  
The master node is deployed on an ubuntu server (4.15.0-142-generic #146~16.04.1-Ubuntu)  
And connected to agents through tunneling on port 50000, agents are windows and connected to the master using the jnlp command.  
Now, all of a sudden some slaves disconnect for the master and when trying to reconnect gives me this error.

```auto
May 14, 2023 12:33:47 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Connecting to <jenkins>:50000 (retrying:7)
java.io.IOException: Failed to connect to <jenkins>:50000 
at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoint.java:248) at hudson.remoting.Engine.connectTcp(Engine.java:900) 
at hudson.remoting.Engine.innerRun(Engine.java:784) 
at hudson.remoting.Engine.run(Engine.java:543)
Caused by: java.net.ConnectException: Connection refused: connect
at java.base/sun.nio.ch.Net.connect0(Native Method) 
at java.base/sun.nio.ch.Net.connect(Net.java:483) 
at java.base/sun.nio.ch.Net.connect(Net.java:472)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:692) 
at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:194)
at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoint.java:206) 
... 3 more                                                                                                                          

```

The master logs are

```auto
May 12, 2023 11:34:33 PM INFO jenkins.slaves.DefaultJnlpSlaveReceiver channelClosed
IOHub#1: Worker[channel:java.nio.channels.SocketChannel[connected local=/<ip>:50000 remote=<served>]] / Computer.threadPoolForRemoting [#903] for vsb-5 terminated: java.nio.channels.ClosedChannelException
May 12, 2023 11:41:15 PM INFO jenkins.slaves.DefaultJnlpSlaveReceiver channelClosed
IOHub#1: Worker[channel:java.nio.channels.SocketChannel[connected local=/<ip>:50000 remote=<server>]] / Computer.threadPoolForRemoting [#908] for vsb-4 terminated: java.nio.channels.ClosedChannelException
May 12, 2023 11:43:11 PM INFO hudson.slaves.ChannelPinger$1 onDead
Ping failed. Terminating the channel vsb-3.
java.util.concurrent.TimeoutException: Ping started at 1683927551978 hasn't completed by 1683927791979
	at hudson.remoting.PingThread.ping(PingThread.java:132)
	at hudson.remoting.PingThread.run(PingThread.java:88)

```

The UI node logs after disconnecting are

```auto
Connection was broken

java.nio.channels.ClosedChannelException
	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:829)

```

I checked everything related to the network, and I found that the port is listening on the host but is not listening inside the container.  
The server metrics (CPU, RAM) are also good.

---

<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:** [May 15, 2023, 3:36pm UTC](https://community.jenkins.io/t/windows-jenkins-slaves-are-disconnecting-and-tunneling-port-stopped-accepting-requests/7372/2 "2023-05-15T15:36:34Z")

</div>

Hi @Ahmed and welcome to this community 👋 ,

As a reminder, the term “slave” to refer to an agent has been deprecated since 2016. Please refer to [On Jenkins Terminology Updates](https://www.jenkins.io/blog/2020/06/18/terminology-update/) for more details. We request you update your post.

---

<div class="post-metadata">

**Author:** ![Ahmed](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@Ahmed](https://community.jenkins.io/u/Ahmed)\
**Post date:** [May 15, 2023, 5:35pm UTC](https://community.jenkins.io/t/windows-jenkins-slaves-are-disconnecting-and-tunneling-port-stopped-accepting-requests/7372/3 "2023-05-15T17:35:17Z")

</div>

Thanks for the heads up. I will update it.
