Hello there!
I am trying to configure Traefik to redirect TCP traffic from Jenkins agents to Jenkins master node in a Kubernetes cluster. The command that Jenkins generates is:
java -jar agent.jar -jnlpUrl https://mylocaljenkinsserver.org/computer/home-inst/jenkins-agent.jnlp -secret @secret-file -workDir "/my/working/dir"
When I execute it I get the following error:
Jun 23, 2022 12:23:44 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using /my/working/dir/remoting as a remoting work directory
Jun 23, 2022 12:23:44 PM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
INFO: Both error and output logs will be printed to /my/working/dir/remoting
Jun 23, 2022 12:23:45 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: bastion-tdc3
Jun 23, 2022 12:23:45 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Jun 23, 2022 12:23:45 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 4.10
Jun 23, 2022 12:23:45 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using /my/working/dir/remoting as a remoting work directory
Jun 23, 2022 12:23:45 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://mylocaljenkinsserver.org/]
Jun 23, 2022 12:23:45 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
Jun 23, 2022 12:23:45 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Agent discovery successful
Agent address: mylocaljenkinsserver.org
Agent port: 50000
Identity: bf:ee:7d:25:9e:04:cf:24:a6:ad:af:ec:60:46:97:3b
Jun 23, 2022 12:23:45 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Jun 23, 2022 12:23:45 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to mylocaljenkinsserver.org:50000
Jun 23, 2022 12:23:45 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP4-connect
Jun 23, 2022 12:23:45 PM org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader run
INFO: Waiting for ProtocolStack to start.
Jun 23, 2022 12:23:45 PM org.jenkinsci.remoting.protocol.impl.AckFilterLayer abort
WARNING: [JNLP4-connect connection to mylocaljenkinsserver.org/10.100.15.235:50000] Incorrect acknowledgement sequence, expected 0x000341434b got 0x485454502f
Jun 23, 2022 12:23:45 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.abort(AckFilterLayer.java:133)
at org.jenkinsci.remoting.protocol.impl.AckFilterLayer.onRecv(AckFilterLayer.java:258)
at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecv(ProtocolStack.java:677)
at org.jenkinsci.remoting.protocol.NetworkLayer.onRead(NetworkLayer.java:136)
at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer.access$2200(BIONetworkLayer.java:49)
at org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader.run(BIONetworkLayer.java:291)
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)
Jun 23, 2022 12:23:45 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)
I don’t understand what’s happening. I am wondering if the TCP redirection I’ve done it’s not correct and the agent use another protocol to communicate.