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

Websocket connections crash if message size is greater than 64Kb

    • Jenkins 2.229

      Websocket connections fail if the response from a pipeline step is greater than 64kb. 

      Steps to recreate the problem:

      1. Run a jenkins server using the docker container jenkins/jenkins:centos
      2. Create a New Node with webSocket enabled
      3. On another Linux VM/slave machine, run the agent.jar with -webSocket option to connect to the Jenkins Master
      4. Create a pipeline with a step that would output text >64kb. For example, create a text file with size > 64Kb. 'cat' the file as a pipeline step. 
      pipeline {
        agent {
          label 'test-channelclose'
        }  
        stages {
          stage ('Debug Issue') {
            steps {
              sh 'cat build_output.log'
              //archiveArtifacts 'build_output.log'
            }
          }
        }
      }
      

      5. Running the pipeline will break with the following error.

      Mar 07, 2020 2:31:28 PM jenkins.agents.WebSocketAgents$Session error
      WARNING: null
      org.eclipse.jetty.websocket.api.MessageTooLargeException: Binary message size [524494] exceeds maximum size [65536]
              at org.eclipse.jetty.websocket.api.WebSocketPolicy.assertValidBinaryMessageSize(WebSocketPolicy.java:128)
              at org.eclipse.jetty.websocket.common.Parser.assertSanePayloadLength(Parser.java:133)
              at org.eclipse.jetty.websocket.common.Parser.parseFrame(Parser.java:494)
              at org.eclipse.jetty.websocket.common.Parser.parseSingleFrame(Parser.java:253)
              at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:460)
              at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:441)
              at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
              at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
              at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
              at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
              at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
              at java.lang.Thread.run(Thread.java:748)

      Note: One of the workaround is to write the output to a file and archive the file. However, not all pipeline steps support an easy way to write the output to file.

          [JENKINS-61409] Websocket connections crash if message size is greater than 64Kb

          Karthik Jayaraman created issue -
          Oleg Nenashev made changes -
          Assignee Original: Jeff Thompson [ jthompson ] New: Jesse Glick [ jglick ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "CloudBees-internal issue (Web Link)" [ 24715 ]
          Daniel Beck made changes -
          Labels Original: websocket New: lts-candidate websocket
          Vincent Latombe made changes -
          Assignee Original: Jesse Glick [ jglick ] New: Vincent Latombe [ vlatombe ]
          Vincent Latombe made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Vincent Latombe made changes -
          Remote Link New: This issue links to "jenkins #4596 (Web Link)" [ 24746 ]
          Vincent Latombe made changes -
          Remote Link New: This issue links to "remoting #373 (Web Link)" [ 24747 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "docker-slave #110 (Web Link)" [ 24801 ]
          Jesse Glick made changes -
          Released As New: 2.229
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Fixed but Unreleased [ 10203 ]

            vlatombe Vincent Latombe
            kjayaraman Karthik Jayaraman
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: