Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-66066

Windows agent can not connect to Jenkins controller

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • core
    • None

    Description

      After upgrade Jenkins master to 2.289.2, Windows agent can't connect to the controller. On the controller, the TCP port for jnlp is fixed port 8888, the port is open to the Windows machine.

      When I run this command "java -jarĀ agent.jar -jnlpUrl https://jenkins-master/computer/test-windows-agent/jenkins-agent.jnlp -secret *** -workDir "c:\jenkins"" on the Windows machine, and run a 'tcpdump" command on the Jenkins master, I saw the tcp packet coming in.

      A "netstat" command on the Jenkins master shows the java app is listening on port 8888.

      The result of the launch command from above is as following, Java 8 is in use on both controller and the Windows machine.

      Jul 06, 2021 8:10:07 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
      INFO: Using c:\jenkins\remoting as a remoting work directory
      Jul 06, 2021 8:10:07 AM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
      INFO: Both error and output logs will be printed to c:\jenkins\remoting
      Jul 06, 2021 8:10:10 AM hudson.remoting.jnlp.Main createEngine
      INFO: Setting up agent: bella-test-windows-agent
      Jul 06, 2021 8:10:10 AM hudson.remoting.jnlp.Main$CuiListener <init>
      INFO: Jenkins agent is running in headless mode.
      Jul 06, 2021 8:10:10 AM hudson.remoting.Engine startEngine
      INFO: Using Remoting version: 4.7
      Jul 06, 2021 8:10:10 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
      INFO: Using c:\jenkins\remoting as a remoting work directory
      Jul 06, 2021 8:10:11 AM hudson.remoting.jnlp.Main$CuiListener error
      SEVERE: Handshake error.
      io.jenkins.remoting.shaded.javax.websocket.DeploymentException: Handshake error.
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:658)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:696)
              at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
              at java.util.concurrent.FutureTask.run(Unknown Source)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:849)
              at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:493)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:337)
              at hudson.remoting.Engine.runWebSocket(Engine.java:623)
              at hudson.remoting.Engine.run(Engine.java:470)
      Caused by: io.jenkins.remoting.shaded.org.glassfish.tyrus.core.HandshakeException: Response code was not 101: 400.
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.TyrusClientEngine.processResponse(TyrusClientEngine.java:299)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.ClientFilter.processRead(ClientFilter.java:167)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:111)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:113)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.SslFilter.handleRead(SslFilter.java:383)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.SslFilter.processRead(SslFilter.java:345)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:111)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:113)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.TransportFilter$4.completed(TransportFilter.java:294)
              at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.TransportFilter$4.completed(TransportFilter.java:278)
              at sun.nio.ch.Invoker.invokeUnchecked(Unknown Source)
              at sun.nio.ch.Invoker$2.run(Unknown Source)
              at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(Unknown Source)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
              at java.lang.Thread.run(Unknown Source)
      

      Please advise what else I can do to troubleshoot. Thanks.

      Attachments

        Activity

          vmlyr_bellaxie Bella created issue -
          slide_o_mix Alex Earl made changes -
          Field Original Value New Value
          Summary Windows agent can not connect to Jenkins master Windows agent can not connect to Jenkins controller
          slide_o_mix Alex Earl made changes -
          Description After upgrade Jenkins master to 2.289.2, Windows agent can't connect to the master. On the master, the TCP port for jnlp is fixed port 8888, the port is open to the Windows machine.

          When I run this command "java -jar agent.jar -jnlpUrl [https://jenkins-master/computer/test-windows-agent/jenkins-agent.jnlp] -secret *** -workDir "c:\jenkins"" on the Windows machine, and run a 'tcpdump" command on the Jenkins master, I saw the tcp packet coming in.

          A "netstat" command on the Jenkins master shows the java app is listening on port 8888.

          The result of the launch command from above is as following, Java 8 is in use on both master and the Windows machine.
          {code:java}
          Jul 06, 2021 8:10:07 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
          INFO: Using c:\jenkins\remoting as a remoting work directory
          Jul 06, 2021 8:10:07 AM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
          INFO: Both error and output logs will be printed to c:\jenkins\remoting
          Jul 06, 2021 8:10:10 AM hudson.remoting.jnlp.Main createEngine
          INFO: Setting up agent: bella-test-windows-agent
          Jul 06, 2021 8:10:10 AM hudson.remoting.jnlp.Main$CuiListener <init>
          INFO: Jenkins agent is running in headless mode.
          Jul 06, 2021 8:10:10 AM hudson.remoting.Engine startEngine
          INFO: Using Remoting version: 4.7
          Jul 06, 2021 8:10:10 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
          INFO: Using c:\jenkins\remoting as a remoting work directory
          Jul 06, 2021 8:10:11 AM hudson.remoting.jnlp.Main$CuiListener error
          SEVERE: Handshake error.
          io.jenkins.remoting.shaded.javax.websocket.DeploymentException: Handshake error.
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:658)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:696)
                  at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
                  at java.util.concurrent.FutureTask.run(Unknown Source)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:849)
                  at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:493)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:337)
                  at hudson.remoting.Engine.runWebSocket(Engine.java:623)
                  at hudson.remoting.Engine.run(Engine.java:470)
          Caused by: io.jenkins.remoting.shaded.org.glassfish.tyrus.core.HandshakeException: Response code was not 101: 400.
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.TyrusClientEngine.processResponse(TyrusClientEngine.java:299)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.ClientFilter.processRead(ClientFilter.java:167)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:111)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:113)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.SslFilter.handleRead(SslFilter.java:383)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.SslFilter.processRead(SslFilter.java:345)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:111)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:113)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.TransportFilter$4.completed(TransportFilter.java:294)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.TransportFilter$4.completed(TransportFilter.java:278)
                  at sun.nio.ch.Invoker.invokeUnchecked(Unknown Source)
                  at sun.nio.ch.Invoker$2.run(Unknown Source)
                  at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(Unknown Source)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
                  at java.lang.Thread.run(Unknown Source)
          {code}
          Please advise what else I can do to troubleshoot. Thanks.
          After upgrade Jenkins master to 2.289.2, Windows agent can't connect to the controller. On the controller, the TCP port for jnlp is fixed port 8888, the port is open to the Windows machine.

          When I run this command "java -jar agent.jar -jnlpUrl [https://jenkins-master/computer/test-windows-agent/jenkins-agent.jnlp] -secret *** -workDir "c:\jenkins"" on the Windows machine, and run a 'tcpdump" command on the Jenkins master, I saw the tcp packet coming in.

          A "netstat" command on the Jenkins master shows the java app is listening on port 8888.

          The result of the launch command from above is as following, Java 8 is in use on both controller and the Windows machine.
          {code:java}
          Jul 06, 2021 8:10:07 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
          INFO: Using c:\jenkins\remoting as a remoting work directory
          Jul 06, 2021 8:10:07 AM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
          INFO: Both error and output logs will be printed to c:\jenkins\remoting
          Jul 06, 2021 8:10:10 AM hudson.remoting.jnlp.Main createEngine
          INFO: Setting up agent: bella-test-windows-agent
          Jul 06, 2021 8:10:10 AM hudson.remoting.jnlp.Main$CuiListener <init>
          INFO: Jenkins agent is running in headless mode.
          Jul 06, 2021 8:10:10 AM hudson.remoting.Engine startEngine
          INFO: Using Remoting version: 4.7
          Jul 06, 2021 8:10:10 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
          INFO: Using c:\jenkins\remoting as a remoting work directory
          Jul 06, 2021 8:10:11 AM hudson.remoting.jnlp.Main$CuiListener error
          SEVERE: Handshake error.
          io.jenkins.remoting.shaded.javax.websocket.DeploymentException: Handshake error.
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:658)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:696)
                  at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
                  at java.util.concurrent.FutureTask.run(Unknown Source)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:849)
                  at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:493)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:337)
                  at hudson.remoting.Engine.runWebSocket(Engine.java:623)
                  at hudson.remoting.Engine.run(Engine.java:470)
          Caused by: io.jenkins.remoting.shaded.org.glassfish.tyrus.core.HandshakeException: Response code was not 101: 400.
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.TyrusClientEngine.processResponse(TyrusClientEngine.java:299)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.ClientFilter.processRead(ClientFilter.java:167)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:111)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:113)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.SslFilter.handleRead(SslFilter.java:383)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.SslFilter.processRead(SslFilter.java:345)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:111)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:113)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.TransportFilter$4.completed(TransportFilter.java:294)
                  at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.TransportFilter$4.completed(TransportFilter.java:278)
                  at sun.nio.ch.Invoker.invokeUnchecked(Unknown Source)
                  at sun.nio.ch.Invoker$2.run(Unknown Source)
                  at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(Unknown Source)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
                  at java.lang.Thread.run(Unknown Source)
          {code}
          Please advise what else I can do to troubleshoot. Thanks.

          People

            Unassigned Unassigned
            vmlyr_bellaxie Bella
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: