# Seeing issue with pod connection after Kubernetes Plugin Upgrade

**URL:** <https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902>\
**Category:** Ask a question\
**Created:** [June 12, 2024, 8:02am UTC](https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902 "2024-06-12T08:02:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hpriya](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hpriya](https://community.jenkins.io/u/hpriya)\
**Post date:** [June 12, 2024, 8:02am UTC](https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902/1 "2024-06-12T08:02:45Z")

</div>

Hey Team,  
Service Details::  
**Jenkins Core Version** : 2.426.3  
**Java** : 11.0.16.1  
**Kubernetes Plugin** : 4186.v1d804571d5d4

After moving kubernetes from `1.30.11` to `4186.v1d804571d5d4`, I am seeing an issue when Jenkins tries to create a Agent.  
Test Connection ::

 ![test-connection](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/d/d992ffba210d48ce35bea803cbab46309f56e947.png)

_Error from the Catalina Logs on Jenkins_

```auto
12-Jun-2024 04:55:07.936 INFO [TCP agent connection handler #35 with /100.101.128.101:26044] hudson.TcpSlaveAgentListener$ConnectionHandler.run Connection #35 from /100.101.128.101:26044 failed: null

```

I tried to manually launch the agent on a Unix VM; this is the error seen

```auto
[root@cne-jenkins bin]# /scratch/sdaas/runtime/jdk-11.0.16.1/bin/java -jar agent.jar -jnlpUrl https://<hostname>:8484/jenkins/computer/oscs%2Doci%2Dscan%2Dksnv5%2D3kbtc/jenkins-agent.jnlp -secret xxxxxxx -workDir ""
Jun 12, 2024 4:56:35 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using /remoting as a remoting work directory
Jun 12, 2024 4:56:35 AM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
INFO: Both error and output logs will be printed to /remoting
Failed to obtain https://<hostname>:8484/jenkins/computer/oscs%2Doci%2Dscan%2Dksnv5%2D3kbtc/jenkins-agent.jnlp?encrypt=true
java.io.IOException: Failed to load https://<hostname>:8484/jenkins/computer/oscs%2Doci%2Dscan%2Dksnv5%2D3kbtc/jenkins-agent.jnlp?encrypt=true: 404 null
	at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:514)
	at hudson.remoting.Launcher.run(Launcher.java:346)
	at hudson.remoting.Launcher.main(Launcher.java:297)
Waiting 10 seconds before retry

```

❓ 💭 Can someone please assist me with what the issue can be with. FYI, There are no concerns with kubernetes v1.30.11.

Also, ❓ Can WebSocket be supported with Tomcat 9? Currently I am seeing the below warning

 ![websocket](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/b/b923aa1d8f8b4aed7994ea2c001dd7dbe8a467a0.png)  
But, the [documentation](https://www.jenkins.io/doc/book/platform-information/support-policy-servlet-containers/) does say `javax.servlet` is supported with TomCat 9

Lastly, Apart from setting the JNLP4-connect protocol under _Manage Jenkins → Security → Agents → Protocols_, Is there a JAVA\_OPTS or env variable that can impose Jenkins to use JNLP4-connect always.

---

<div class="post-metadata">

**Author:** ![hpriya](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hpriya](https://community.jenkins.io/u/hpriya)\
**Post date:** [June 12, 2024, 9:21am UTC](https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902/2 "2024-06-12T09:21:35Z")

</div>

Lately, we have been seeing issue while getting the Agent Protocol even though the Protocol is enabled under Security.

```auto
May 31, 2024 7:02:45 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP4-connect
May 31, 2024 7:02:45 PM org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader run
INFO: Waiting for ProtocolStack to start.
May 31, 2024 7:02:55 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Protocol JNLP4-connect encountered an unexpected exception
java.util.concurrent.ExecutionException: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Connection closed before acknowledgement sent
	at org.jenkinsci.remoting.util.SettableFuture.get(SettableFuture.java:223)
	at hudson.remoting.Engine.innerRun(Engine.java:778)
	at hudson.remoting.Engine.run(Engine.java:540)
Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Connection closed before acknowledgement sent
	at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.onRecvClosed(AckFilterLayer.java:280)
	at org.jenkinsci.remoting.protocol.FilterLayer.abort(FilterLayer.java:164)
	at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.lambda$start$0(AckFilterLayer.java:177)
	at org.jenkinsci.remoting.protocol.IOHub$DelayedRunnable.run(IOHub.java:959)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
	at java.base/java.lang.Thread.run(Thread.java:829)

May 31, 2024 7:02:56 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: The server rejected the connection: None of the protocols were accepted
java.lang.Exception: The server rejected the connection: None of the protocols were accepted
	at hudson.remoting.Engine.onConnectionRejected(Engine.java:864)
	at hudson.remoting.Engine.innerRun(Engine.java:804)
	at hudson.remoting.Engine.run(Engine.java:540)

```

---

<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:** [June 13, 2024, 6:55am UTC](https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902/3 "2024-06-13T06:55:25Z")

</div>

Hi,

The error messages you’re seeing suggest a few different issues 😢 :

1. `Failed to load jenkins-agent.jnlp: 404 null`: it looks like the Jenkins agent is unable to fetch the JNLP file from the Jenkins controller. This could be due to a number of reasons, such as network connectivity issues, incorrect Jenkins URL, or the agent not being properly configured on the Jenkins controller. It would help if you verified that the Jenkins URL is correct and that the agent is properly configured on the Jenkins controller.
2. `Connection closed before acknowledgment sent`: the connection between the Jenkins controller and the agent may be closed before the connection can be fully established. This could be due to network issues, or it could be a problem with the JNLP4-connect protocol. You might want to try using a different protocol to see if that resolves the issue.
3. WebSocket support with Tomcat 9: Yes, [WebSocket is supported with Tomcat 9](https://tomcat.apache.org/tomcat-9.0-doc/web-socket-howto.html). However, the warning message you’re seeing suggests that the WebSocket feature is not enabled in your Tomcat configuration. You should check your Tomcat configuration to ensure that WebSocket is enabled.
4. Setting the JNLP4-connect protocol: I think you can set the `JNLP_PROTOCOL_OPTS` environment variable to specify the protocols that the Jenkins agent should use. For example, you could set `JNLP_PROTOCOL_OPTS=-Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=true -Dorg.jenkinsci.remoting.engine.JnlpProtocol4.disabled=false` to disable the `JNLP3` protocol and enable the `JNLP4` protocol.

---

<div class="post-metadata">

**Author:** ![hpriya](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hpriya](https://community.jenkins.io/u/hpriya)\
**Post date:** [June 13, 2024, 9:40am UTC](https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902/4 "2024-06-13T09:40:02Z")

</div>

Thank you @poddingue I will work the recommendations ⭐

---

<div class="post-metadata">

**Author:** ![hpriya](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hpriya](https://community.jenkins.io/u/hpriya)\
**Post date:** [June 13, 2024, 1:15pm UTC](https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902/5 "2024-06-13T13:15:15Z")

</div>

> [@poddingue](#):
>
> `Connection closed before acknowledgment sent`:

Sometimes, we also see

```auto
13:01:45 INFO: Waiting for ProtocolStack to start.
13:01:45 Jun 13, 2024 1:01:17 PM org.jenkinsci.remoting.protocol.impl.AckFilterLayer abort
13:01:45 WARNING: [JNLP4-connect connection to cne-jenkins-drtest.us.oracle.com/100.101.128.226:50000] Incorrect acknowledgement sequence, expected 0x000341434b got 0x4469736162
13:01:45 Jun 13, 2024 1:01:17 PM hudson.remoting.jnlp.Main$CuiListener status
13:01:45 INFO: Protocol JNLP4-connect encountered an unexpected exception
13:01:45 java.util.concurrent.ExecutionException: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Connection closed before acknowledgement sent
13:01:45 at org.jenkinsci.remoting.util.SettableFuture.get(SettableFuture.java:223)
13:01:45 at hudson.remoting.Engine.innerRun(Engine.java:778)
13:01:45 at hudson.remoting.Engine.run(Engine.java:540)
13:01:45 Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Connection closed before acknowledgement sent

```

❓ How can we control the acknowledgement sequence?

---

<div class="post-metadata">

**Author:** ![Aric000](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/aric000/32/9127_2.png) [@Aric000](https://community.jenkins.io/u/Aric000)\
**Post date:** [July 17, 2024, 3:14am UTC](https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902/6 "2024-07-17T03:14:58Z")

</div>

hi guys，did you solve it？I have the same question.

---

<div class="post-metadata">

**Author:** ![hpriya](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hpriya](https://community.jenkins.io/u/hpriya)\
**Post date:** [August 8, 2024, 2:39pm UTC](https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902/7 "2024-08-08T14:39:05Z")

</div>

> [@hpriya](#):
>
> 4186.v1d804571d5d4

We haven’t resolved it yet, but we plan to upgrade k8s to higher version.

> Planning to upgrade to 4250.v93f47a\_8e67b\_f

---

<div class="post-metadata">

**Author:** ![gowrinath225](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gowrinath225](https://community.jenkins.io/u/gowrinath225)\
**Post date:** [September 27, 2024, 7:17am UTC](https://community.jenkins.io/t/seeing-issue-with-pod-connection-after-kubernetes-plugin-upgrade/15902/8 "2024-09-27T07:17:29Z")

</div>

did you found any solution for this
