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

CLI, Agent -websockets DeploymentException: Handshake response not received on jdk-11

    • 2.317

      Testing CLI, agent connections with the new '-websocket' functionality added by
      JEP-222.

       

      Jetty access log shows:

      172.18.0.3 - - [25/Feb/2020:01:48:06 +0000] "GET /cli/ws HTTP/1.1" 101 0 "-" "-" 
      

      CLI output:

      javax.websocket.DeploymentException: Handshake response not received.
      	at org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:694)
      	at org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:712)
      ...
      	at org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:866)
      	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
      	at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:511)
      	at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:355)
      	at hudson.cli.CLI.webSocketConnection(CLI.java:323)
      	at hudson.cli.CLI._main(CLI.java:301)
      	at hudson.cli.CLI.main(CLI.java:95)
      

      When I attach a debugger to the Jenkins server it seems to get stuck here:
      https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/cli/CLIAction.java#L255

          [JENKINS-61212] CLI, Agent -websockets DeploymentException: Handshake response not received on jdk-11

          Fred Vogt created issue -
          Fred Vogt made changes -
          Description Original: Testing CLI, agent connections with the new '-websocket' functionality added by JEP-222.

          Jetty access log shows:
          {code}
          172.18.0.3 - - [25/Feb/2020:01:48:06 +0000] "GET /cli/ws HTTP/1.1" 101 0 "-" "-"
          {code}

          CLI output:
          {code}
          javax.websocket.DeploymentException: Handshake response not received.
          at org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:694)
          at org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:712)
          ...
          at org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:866)
          at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
          at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:511)
          at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:355)
          at hudson.cli.CLI.webSocketConnection(CLI.java:323)
          at hudson.cli.CLI._main(CLI.java:301)
          at hudson.cli.CLI.main(CLI.java:95)
          {code}

          When I attach a debugger to the Jenkins server it seems to get stuck here:
          https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/cli/CLIAction.java#L255
          New: Testing CLI, agent connections with the new '-websocket' functionality added by [JEP-222|[https://github.com/jenkinsci/jep/blob/master/jep/222/README.adoc]].

          Jetty access log shows:
          {code:java}
          172.18.0.3 - - [25/Feb/2020:01:48:06 +0000] "GET /cli/ws HTTP/1.1" 101 0 "-" "-"
          {code}
          CLI output:
          {code:java}
          javax.websocket.DeploymentException: Handshake response not received.
          at org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:694)
          at org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:712)
          ...
          at org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:866)
          at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
          at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:511)
          at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:355)
          at hudson.cli.CLI.webSocketConnection(CLI.java:323)
          at hudson.cli.CLI._main(CLI.java:301)
          at hudson.cli.CLI.main(CLI.java:95)
          {code}
          When I attach a debugger to the Jenkins server it seems to get stuck here:
           [https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/cli/CLIAction.java#L255]
          Fred Vogt made changes -
          Description Original: Testing CLI, agent connections with the new '-websocket' functionality added by [JEP-222|[https://github.com/jenkinsci/jep/blob/master/jep/222/README.adoc]].

          Jetty access log shows:
          {code:java}
          172.18.0.3 - - [25/Feb/2020:01:48:06 +0000] "GET /cli/ws HTTP/1.1" 101 0 "-" "-"
          {code}
          CLI output:
          {code:java}
          javax.websocket.DeploymentException: Handshake response not received.
          at org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:694)
          at org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:712)
          ...
          at org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:866)
          at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
          at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:511)
          at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:355)
          at hudson.cli.CLI.webSocketConnection(CLI.java:323)
          at hudson.cli.CLI._main(CLI.java:301)
          at hudson.cli.CLI.main(CLI.java:95)
          {code}
          When I attach a debugger to the Jenkins server it seems to get stuck here:
           [https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/cli/CLIAction.java#L255]
          New: Testing CLI, agent connections with the new '-websocket' functionality added by
          [JEP-222|https://github.com/jenkinsci/jep/blob/master/jep/222/README.adoc].

           

          Jetty access log shows:
          {code:java}
          172.18.0.3 - - [25/Feb/2020:01:48:06 +0000] "GET /cli/ws HTTP/1.1" 101 0 "-" "-"
          {code}
          CLI output:
          {code:java}
          javax.websocket.DeploymentException: Handshake response not received.
          at org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:694)
          at org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:712)
          ...
          at org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:866)
          at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
          at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:511)
          at org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:355)
          at hudson.cli.CLI.webSocketConnection(CLI.java:323)
          at hudson.cli.CLI._main(CLI.java:301)
          at hudson.cli.CLI.main(CLI.java:95)
          {code}
          When I attach a debugger to the Jenkins server it seems to get stuck here:
           [https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/cli/CLIAction.java#L255]
          Fred Vogt made changes -
          Summary Original: CLI, Agent -websockets hangs, then DeploymentException: Handshake response not received New: CLI, Agent -websockets DeploymentException: Handshake response not received

          Oleg Nenashev added a comment -

          CC jglick

          Oleg Nenashev added a comment - CC jglick
          Oleg Nenashev made changes -
          Assignee New: Jesse Glick [ jglick ]

          Jesse Glick added a comment -

          Probably something specific to your environment. First try using JDK 8 on both client and server (11 is in general poorly tested in Jenkins). Then check your service setup. You are using the built-in Winstone/Jetty servlet container? How is HTTPS being terminated—by Jetty’s built-in options (never before tested with WebSocket AFAIK), or using some sort of reverse proxy (which)?

          Jesse Glick added a comment - Probably something specific to your environment. First try using JDK 8 on both client and server (11 is in general poorly tested in Jenkins). Then check your service setup. You are using the built-in Winstone/Jetty servlet container? How is HTTPS being terminated—by Jetty’s built-in options (never before tested with WebSocket AFAIK), or using some sort of reverse proxy (which)?
          Oleg Nenashev made changes -
          Comment [ [https://github.com/jenkinsci/jenkins/pull/4526] - my draft. It is a bit different from what Jesse suggested ]

          Oleg Nenashev added a comment -

          UPD: deleted comment, wrong ticket

          Oleg Nenashev added a comment - UPD: deleted comment, wrong ticket

          Fred Vogt added a comment -

          jglick - thanks  for the prompt response.

          You are probably right.  I'll do testing with different combinations of jdk-8 and without HTTPS today.

          It will take me a bit of time to come up with the smallest reproducible setup and test with jdk-8.

          server-*.pem is a self-signed cert with :

          localhost
          127.0.0.1
          jenkins-server
          

          google chrome likes it when imported (Mac/Linux)

          The client / agent are connecting using a different container over a bridge network.

          server:

          # winstone args
          --httpsPort=${HTTPS_PORT-8443} \
          --httpsPrivateKey=/var/jenkins_home/tls/server-rsa.pem \
          --httpsCertificate=/var/jenkins_home/tls/server-cert.pem} \
          --extraLibFolder=/var/jenkins_home/extraLibs \
          --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger \
          --simpleAccessLogger.format=combined \
          --simpleAccessLogger.file=/var/jenkins_home/logs/access.log  \
          

          client:

          java \
            -Djavax.net.ssl.trustStore=/var/lib/jenkins/truststore.jks \
            -Djavax.net.ssl.trustStorePassword=jenkins \
            -Djava.util.logging.config.file=/var/lib/jenkins/debug-logging.properties  \
            -jar "../jenkins-cli.jar" \
            -s "https://jenkins-server:8443" \
            -webSocket \
            -logger FINE \
            -auth "$AGENT_AUTH" \
            <args>
          

          Fred Vogt added a comment - jglick - thanks  for the prompt response. You are probably right.  I'll do testing with different combinations of jdk-8 and without HTTPS today. It will take me a bit of time to come up with the smallest reproducible setup and test with jdk-8. server-*.pem is a self-signed cert with : localhost 127.0.0.1 jenkins-server google chrome likes it when imported (Mac/Linux) The client / agent are connecting using a different container over a bridge network. server: # winstone args --httpsPort=${HTTPS_PORT-8443} \ --httpsPrivateKey=/ var /jenkins_home/tls/server-rsa.pem \ --httpsCertificate=/ var /jenkins_home/tls/server-cert.pem} \ --extraLibFolder=/ var /jenkins_home/extraLibs \ --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger \ --simpleAccessLogger.format=combined \ --simpleAccessLogger.file=/ var /jenkins_home/logs/access.log \ client: java \ -Djavax.net.ssl.trustStore=/ var /lib/jenkins/truststore.jks \ -Djavax.net.ssl.trustStorePassword=jenkins \ -Djava.util.logging.config.file=/ var /lib/jenkins/debug-logging.properties \ -jar "../jenkins-cli.jar" \ -s "https: //jenkins-server:8443" \ -webSocket \ -logger FINE \ -auth "$AGENT_AUTH" \ <args>

            Unassigned Unassigned
            build_admiral Fred Vogt
            Votes:
            9 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: