# Windows agents are unable to connect to Jenkins

**URL:** <https://community.jenkins.io/t/windows-agents-are-unable-to-connect-to-jenkins/12654>\
**Category:** Using Jenkins\
**Tags:** question\
**Created:** [February 21, 2024, 10:46pm UTC](https://community.jenkins.io/t/windows-agents-are-unable-to-connect-to-jenkins/12654 "2024-02-21T22:46:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanuman.bandhu](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@hanuman.bandhu](https://community.jenkins.io/u/hanuman.bandhu)\
**Post date:** [February 21, 2024, 10:46pm UTC](https://community.jenkins.io/t/windows-agents-are-unable-to-connect-to-jenkins/12654/1 "2024-02-21T22:46:47Z")

</div>

he Windows VMS connected earlier to Jenkins as an agent are in offline now and unable to connect again with error “port:49187 is not reachable”.  
Jenkins version - 2.164.2  
JDK - jdk1.8

> Feb 20, 2024 6:02:46 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir  
> INFO: Using C:\Jenkins\remoting as a remoting work directory  
> Both error and output logs will be printed to C:\Jenkins\remoting  
> Feb 20, 2024 6:02:46 PM hudson.remoting.jnlp.Main createEngine  
> INFO: Setting up agent: DPVMNLDEV1  
> Feb 20, 2024 6:02:46 PM hudson.remoting.jnlp.Main$CuiListener   
> INFO: Jenkins agent is running in headless mode.  
> Feb 20, 2024 6:02:46 PM hudson.remoting.Engine startEngine  
> INFO: Using Remoting version: 3.29  
> Feb 20, 2024 6:02:46 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir  
> INFO: Using C:\Jenkins\remoting as a remoting work directory  
> Feb 20, 2024 6:02:47 PM hudson.remoting.jnlp.Main$CuiListener status  
> INFO: Locating server among [  
> [https://jenkins.devops.com/](https://jenkins.devops.com/)  
> ,

> Feb 20, 2024 6:02:47 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve  
> INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping, JNLP3-connect]  
> Feb 20, 2024 6:02:52 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver isPortVisible  
> WARNING: connect timed out  
> Feb 20, 2024 6:02:52 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve  
> INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping, JNLP3-connect]  
> Feb 20, 2024 6:02:53 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver isPortVisible  
> WARNING: Connection refused: connect  
> Feb 20, 2024 6:02:53 PM hudson.remoting.jnlp.Main$CuiListener error  
> SEVERE:  
> [https://jenkins.devops.com/](https://jenkins.devops.com/)  
> provided port:49187 is not reachable  
> java.io.IOException:  
> [https://jenkins.devops.com/](https://jenkins.devops.com/)  
> provided port:49187 is not reachable  
> at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:287)  
> at hudson.remoting.Engine.innerRun(Engine.java:523)  
> at hudson.remoting.Engine.run(Engine.java:474)  
> Suppressed: java.io.IOException:  
> [https://jenkins.devops/com:8080/](https://jenkins.devops/com:8080/)  
> provided port:49187 is not reachable  
> … 3 more

We have checked with network and infosec team, no changes from their end and no changes made in Jenkins or Windows VMs recently .

Few agents in same network are able to connect and few are giving above error .

---

<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:** [February 26, 2024, 10:27am UTC](https://community.jenkins.io/t/windows-agents-are-unable-to-connect-to-jenkins/12654/2 "2024-02-26T10:27:18Z")

</div>

Welcome back @hanuman.bandhu .

From the Jenkins controller, can you see the `49187` port of the disconnected agent (thanks to telnet or another tool)?  
On the Windows Jenkins agent, is the port marked as listening?  
In Windows, you can use the `netstat` command to check if a specific port is listening. However, this command needs to be run in the Command Prompt or PowerShell. Here’s how you can do it:

1. Open Command Prompt or PowerShell on the agent machine.
2. Type the following command and press Enter: `netstat -ano | findstr :49187`
