# Windows Jenkins Agent getting frequently disconnected from master

**URL:** <https://community.jenkins.io/t/windows-jenkins-agent-getting-frequently-disconnected-from-master/27054>\
**Category:** Ask a question\
**Created:** [February 17, 2025, 4:46am UTC](https://community.jenkins.io/t/windows-jenkins-agent-getting-frequently-disconnected-from-master/27054 "2025-02-17T04:46:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pradip10](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@pradip10](https://community.jenkins.io/u/pradip10)\
**Post date:** [February 17, 2025, 4:46am UTC](https://community.jenkins.io/t/windows-jenkins-agent-getting-frequently-disconnected-from-master/27054/1 "2025-02-17T04:46:23Z")

</div>

Hello,

We are using Jenkins 2.479.3 LTS, it seems that Windows agent disconnecting randomly with below errors:

Remoting version: 3261.v9c670a\_4748a\_9  
Launcher: JNLPLauncher  
Communication Protocol: JNLP4-connect  
This is a Windows agent  
Updating existing installations for   
ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins  
java.lang.NoSuchMethodException: java.lang.Class.getDeclaredFields0(boolean)  
at java.base/java.lang.Class.newNoSuchMethodException(Class.java:660)  
at java.base/java.lang.Class.throwExceptionOrReturnNull(Class.java:1460)  
at java.base/java.lang.Class.getMethodHelper(Class.java:1557)  
at java.base/java.lang.Class.getDeclaredMethod(Class.java:1132)  
at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.getModifiers(EnvInjectMasterEnvVarsSetter.java:28)  
at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:67)  
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from /:56595  
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1923)  
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:384)  
at hudson.remoting.Channel.call(Channel.java:1112)  
at hudson.FilePath.act(FilePath.java:1319)  
at PluginClassLoader for envinject//org.jenkinsci.plugins.envinject.EnvInjectComputerListener.onOnline(EnvInjectComputerListener.java:144)  
at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:751)  
at jenkins.slaves.DefaultJnlpSlaveReceiver.afterChannel(DefaultJnlpSlaveReceiver.java:176)  
at org.jenkinsci.remoting.engine.JnlpConnectionState.fire(JnlpConnectionState.java:336)  
at org.jenkinsci.remoting.engine.JnlpConnectionState.fireAfterChannel(JnlpConnectionState.java:427)  
at org.jenkinsci.remoting.engine.JnlpProtocol4Handler$Handler.lambda$onChannel$0(JnlpProtocol4Handler.java:354)  
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)  
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)  
at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)  
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)  
Caused: java.lang.RuntimeException  
at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:74)  
at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:19)  
at hudson.remoting.UserRequest.perform(UserRequest.java:225)  
at hudson.remoting.UserRequest.perform(UserRequest.java:50)  
at hudson.remoting.Request$2.run(Request.java:391)  
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:81)  
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)  
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)  
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:140)  
at java.base/java.lang.Thread.run(Thread.java:857)

Could you please have a look at above logs and suggest fix for it ? Thanks in advance

---

<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 17, 2025, 6:29am UTC](https://community.jenkins.io/t/windows-jenkins-agent-getting-frequently-disconnected-from-master/27054/2 "2025-02-17T06:29:41Z")

</div>

Check the upgrade guide for 2.479.x about that the envinject plugin. Although this doesn’t lead to a disconnection of the agent.

---

<div class="post-metadata">

**Author:** ![pradip10](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@pradip10](https://community.jenkins.io/u/pradip10)\
**Post date:** [February 17, 2025, 7:52am UTC](https://community.jenkins.io/t/windows-jenkins-agent-getting-frequently-disconnected-from-master/27054/3 "2025-02-17T07:52:40Z")

</div>

I have gone through upgrade guide for 2.479.x and followed it. Let’s see how agent behave now
