# Agent disconnecting periodically

**URL:** <https://community.jenkins.io/t/agent-disconnecting-periodically/26595>\
**Category:** Using Jenkins\
**Tags:** question\
**Created:** [February 5, 2025, 8:33am UTC](https://community.jenkins.io/t/agent-disconnecting-periodically/26595 "2025-02-05T08:33:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![barath\_jk](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@barath\_jk](https://community.jenkins.io/u/barath_jk)\
**Post date:** [February 5, 2025, 8:33am UTC](https://community.jenkins.io/t/agent-disconnecting-periodically/26595/1 "2025-02-05T08:33:21Z")

</div>

Hey all,  
I have installed the recent LTS version of Jenkins in windows, I have connected two windows agent machines which has same configuration as my controller machine and same version of Java.

Now, my problem is agents are getting disconnected for every 7hours, even though jobs are running in it and getting connected back in few seconds.

 ![log_files_slave_disconnect](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/7/75d60da7d7c065bee863e8a245d1492bdac24e8e.png)

I have connected the slaves through the batch command given in the agent page of Jenkins.

## Jenkins setup: Jenkins: 2.479.3 OS: Windows 10 - 10.0 Java: 17.0.9 - Azul Systems, Inc. (OpenJDK 64-Bit Server VM)

ant:511.v0a\_a\_1a\_334f41b\_  
antisamy-markup-formatter:162.v0e6ec0fcfcf6  
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757  
asm-api:9.7.1-97.v4cc844130d97  
bootstrap5-api:5.3.3-1  
bouncycastle-api:2.30.1.80-256.vf98926042a\_9b\_  
branch-api:2.1208.vf528356feca\_4  
build-timeout:1.35  
caffeine-api:3.1.8-133.v17b\_1ff2e0599  
checks-api:2.2.1  
cloudbees-folder:6.980.v5a\_cc0cb\_25881  
commons-lang3-api:3.17.0-84.vb\_b\_938040b\_078  
commons-text-api:1.13.0-153.v91dcd89e2a\_22  
credentials:1405.vb\_cda\_74a\_f8974  
credentials-binding:687.v619cb\_15e923f  
dark-theme:524.vd675b\_22b\_30cb\_  
display-url-api:2.209.v582ed814ff2f  
durable-task:581.v299a\_5609d767  
echarts-api:5.5.1-5  
eddsa-api:0.3.0-4.v84c6f0f4969e  
email-ext:1876.v28d8d38315b\_d  
font-awesome-api:6.6.0-2  
git:5.7.0  
git-client:6.1.1  
github:1.41.0  
github-api:1.321-478.vc9ce627ce001  
github-branch-source:1810.v913311241fa\_9  
gradle:2.14  
gson-api:2.12.1-113.v347686d6729f  
instance-identity:201.vd2a\_b\_5a\_468a\_a\_6  
ionicons-api:74.v93d5eb\_813d5f  
jackson2-api:2.17.0-379.v02de8ec9f64c  
jakarta-activation-api:2.1.3-1  
jakarta-mail-api:2.1.3-1  
javax-activation-api:1.2.0-7  
jaxb:2.3.9-1  
jjwt-api:0.11.5-112.ve82dfb\_224b\_a\_d  
joda-time-api:2.13.1-115.va\_6b\_5f8efb\_1d8  
jquery3-api:3.7.1-2  
json-api:20250107-125.v28b\_a\_ffa\_eb\_f01  
json-path-api:2.9.0-138.vc943da\_d833b\_6  
junit:1312.v1a\_235a\_b\_94a\_31  
ldap:776.vddf3e325103b\_  
mailer:489.vd4b\_25144138f  
matrix-auth:3.2.4  
matrix-project:845.vffd7fa\_f27555  
metrics:4.2.21-461.v881e35d8fa\_b\_a\_  
mina-sshd-api-common:2.14.0-143.v2b\_362fc39576  
mina-sshd-api-core:2.14.0-143.v2b\_362fc39576  
okhttp-api:4.11.0-183.va\_87fc7a\_89810  
pam-auth:1.11  
pipeline-build-step:551.v178956c49ef8  
pipeline-github-lib:61.v629f2cc41d83  
pipeline-graph-analysis:216.vfd8b\_ece330ca\_  
pipeline-graph-view:406.v06871361eb\_2d  
pipeline-groovy-lib:749.v70084559234a\_  
pipeline-input-step:508.v584c0e9a\_2177  
pipeline-milestone-step:119.vdfdc43fc3b\_9a\_  
pipeline-model-api:2.2221.vc657003fb\_d93  
pipeline-model-definition:2.2221.vc657003fb\_d93  
pipeline-model-extensions:2.2221.vc657003fb\_d93  
pipeline-stage-step:312.v8cd10304c27a\_  
pipeline-stage-tags-metadata:2.2221.vc657003fb\_d93  
plain-credentials:183.va\_de8f1dd5a\_2b\_  
plugin-util-api:5.1.0  
resource-disposer:0.25  
scm-api:703.v72ff4b\_259600  
script-security:1369.v9b\_98a\_4e95b\_2d  
snakeyaml-api:2.3-123.v13484c65210a\_  
ssh-credentials:349.vb\_8b\_6b\_9709f5b\_  
ssh-slaves:3.1021.va\_cc11b\_de26a\_e  
structs:338.v848422169819  
theme-manager:278.v2e3c063e42cc  
timestamper:1.28  
token-macro:442.v4f452dc3c7c0  
trilead-api:2.147.vb\_73cc728a\_32e  
variant:70.va\_d9f17f859e0  
workflow-aggregator:600.vb\_57cdd26fdd7  
workflow-api:1363.v03f731255494  
workflow-basic-steps:1079.vce64b\_a\_929c5a\_  
workflow-cps:4014.vcd7dc51d8b\_30  
workflow-durable-task-step:1405.v1fcd4a\_d00096  
workflow-job:1498.v33a\_0c6f3a\_4b\_4  
workflow-multibranch:800.v5f0a\_a\_660950e  
workflow-scm-step:427.v4ca\_6512e7df1  
workflow-step-api:686.v603d058a\_e148  
workflow-support:944.v5a\_859593b\_98a\_  
ws-cleanup:0.48

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [February 5, 2025, 10:39am UTC](https://community.jenkins.io/t/agent-disconnecting-periodically/26595/2 "2025-02-05T10:39:46Z")

</div>

I doubt this is a Jenkins problem. More likely related to your network that something is terminating the websocket after 7 hours.  
PS: the term `slave` is deprecated please use `agent` instead

---

<div class="post-metadata">

**Author:** ![barath\_jk](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@barath\_jk](https://community.jenkins.io/u/barath_jk)\
**Post date:** [February 5, 2025, 12:04pm UTC](https://community.jenkins.io/t/agent-disconnecting-periodically/26595/3 "2025-02-05T12:04:22Z")

</div>

Thanks Markus!  
I had tried with two versions of Jenkins, still disconnecting periodically.

1. Is there any other way to connect to agent instead of websocket.?
2. how to remove the timeout of 7hrs in network settings?
3. or any other method is there to connect Jenkins, I had tried already with the windows service and running the command through cmd, still issue persists.

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [February 5, 2025, 12:16pm UTC](https://community.jenkins.io/t/agent-disconnecting-periodically/26595/4 "2025-02-05T12:16:32Z")

</div>

1. you can try with ssh (the connection is initiated from the Jenkins controller) but it requires that you have the openssh properly configured on the agent machines. But there is no guarantee that you don’t run into the same problem with the timeout
2. I don’t know where this timeout could be coming from but it is not Jenkins. Ask the responsibles for your network in your IT department

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [February 5, 2025, 12:31pm UTC](https://community.jenkins.io/t/agent-disconnecting-periodically/26595/5 "2025-02-05T12:31:23Z")

</div>

do you have some reverse proxy setup by chance?

---

<div class="post-metadata">

**Author:** ![barath\_jk](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@barath\_jk](https://community.jenkins.io/u/barath_jk)\
**Post date:** [February 5, 2025, 1:10pm UTC](https://community.jenkins.io/t/agent-disconnecting-periodically/26595/6 "2025-02-05T13:10:49Z")

</div>

No, I do not have any reverse proxy

```auto
netsh winhttp show proxy

Current WinHTTP proxy settings:

    Direct access (no proxy server).

```

I am facing this issue after migrating my Jenkins to other windows machine.

---

<div class="post-metadata">

**Author:** ![barath\_jk](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@barath\_jk](https://community.jenkins.io/u/barath_jk)\
**Post date:** [March 31, 2025, 10:27am UTC](https://community.jenkins.io/t/agent-disconnecting-periodically/26595/7 "2025-03-31T10:27:47Z")

</div>

Issue solved after connecting the agent without websocket option in the command!
