0

When trying to connect an agent node (Rhel) using the "java -jar agent.jar -jnlpUrl", the connection is not successful. Getting the error "Protocol JNLP4-connect encountered an unexpected exception" The error stack is below:

Jul 05, 2022 12:26:55 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http://app.test.sl.com:8080/]
Jul 05, 2022 12:26:55 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
Jul 05, 2022 12:26:55 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Agent discovery successful
  Agent address: app.test.sl.com
  Agent port:    50000
  Identity:      c8:4d:*:*:*:*:*:*:*:*:*:*:*:*:*:*
Jul 05, 2022 12:26:55 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Jul 05, 2022 12:26:55 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to app.test.sl.com:50000
Jul 05, 2022 12:26:55 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP4-connect
Jul 05, 2022 12:26:55 AM org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader run
INFO: Waiting for ProtocolStack to start.
Jul 05, 2022 12:26:55 AM 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:799)
        at hudson.remoting.Engine.run(Engine.java:544)
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.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:825)
        at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:155)
        at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer.access$1500(BIONetworkLayer.java:51)
        at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader.run(BIONetworkLayer.java:257)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:126)
        at hudson.remoting.Engine$1$$Lambda$9/0000000048003ED0.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:820)

Jul 05, 2022 12:26:55 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: reconnect rejected, sleeping 10s:
java.lang.Exception: The server rejected the connection: None of the protocols were accepted
        at hudson.remoting.Engine.onConnectionRejected(Engine.java:878)
        at hudson.remoting.Engine.innerRun(Engine.java:825)
        at hudson.remoting.Engine.run(Engine.java:544)

Jenkins Logs

javax.net.ssl.SSLHandshakeException: Client requested protocol TLSv1 is not enabled or supported in server context
kr_devops
  • 117
  • 3
  • 14
  • Is this your issue? https://stackoverflow.com/a/59775773/2627018 – ycr Jul 05 '22 at 11:57
  • @ycr Tried the solutions mention, but it did not work out I have updated the question with jenkins logs – kr_devops Jul 06 '22 at 09:37
  • Are you running two different Java versions for the Master and Agent? You can try to force the Agent to use TLSv1.2 with `-Dhttps.protocols=TLSv1.2` or try enabling TLSv1 for the master. – ycr Jul 06 '22 at 12:21
  • Where / which file can I enable TLSv1 for master? – kr_devops Jul 06 '22 at 12:36
  • Pass the aforementioned flag on server startup. Simply add it to `JENKINS_OPTS` and restart the master. – ycr Jul 06 '22 at 12:48

0 Answers0