search cancel

CDD Websocket Updates To Client/Browser

book

Article ID: 227293

calendar_today

Updated On:

Products

Continuous Delivery Director

Issue/Introduction

After updating the value of a token, the updated value is not appearing until I manually refresh the page. A manual refresh of the page wasn't necessary in the past.  

Environment

Release : 8.2

Component : CONTINUOUS DELIVERY DIRECTOR

Cause

The WebSocket protocol is blocked by a network element in between the browser and CDD Tomcat server.

 

Explanation: 

When you log into CDD it creates a WebSocket connection. Once the websocket connection is created, subsequent navigating from the client side browser sends SUBSCRIBE/UNSUBSCRIBE requests to the CDD Server. In an environment where WebSockets are not blocked, these subscriptions are used by the CDD Server to push notifications to the client browser when an update has been made. The pushed notification is used by the client browser to reflect the updated object. 

These types of CDD UI push/notification updates will happen for things like creating a new phase and/or updating a token.

 
 

Resolution

Work with the network team(s) to ensure that WebSocket protocol messages are not blocked. 

 

Additional Information

To help troubleshoot, in an environment where the WebSocket protocol is not blocked, the following message should be seen when a user logs into the CDD UI:

apache-tomcat/logs/localhost_access_log.2021-10-09.txt:
ip.address.of.client - - [09/Oct/2021:12:46:15 +0300] "GET /cdd/websocket/ws HTTP/1.1" 101 -

 

cdd-access.<server>.log
2021-10-09 12:46:14.851 [http-nio-8080-exec-10] - [METHOD: GET] [URL: http://<cddServer>:8080/cdd/websocket/ws] [USER: null] [HOST: ip.address.of.client] [REQUEST_CONTENT_LENGTH: -1] [START TIME: 09/10/2021 12:46:14.851]
2021-10-09 12:46:15.255 [http-nio-8080-exec-10] - [METHOD: GET] [URL: http://<cddServer>:8080/cdd/websocket/ws] [USER: null] [HOST: ip.address.of.client] [REQUEST_CONTENT_LENGTH: -1] [START TIME: 09/10/2021 12:46:14.851] [DURATION: 404 ms] [HTTP_STATUS_CODE: 101] [RESPONSE_CONTENT_LENGTH: -1]

 

If you are seeing the messages above then it indicates that the websocket connection is being established between the cddServer and the client browser. If you are not seeing these messages then the following steps can be followed to share with your network team to help diagnose:

  1. Logout from CDD.
  2. Open the chrome network console ( F12 )
  3. Login to CDD.
  4. At the chrome browser console , click on Network and then WS 
  5. After clicking the WS tab - you should see a "ws" request at the left panel of the chrome network console.
  6. Select the  "ws" request in the left panel and then Messages
    This is where you should see a CONNECT/CONNECTED message as shown in picture 1 (below).
  7. When you open a specific release page, you can see at this Messages tab - the SUBSCRIBE websocket request for WebSocket messages.
    Examples of these SUBSCRIBE messages can be seen in picture 2 (below).
  8. When you create a new phase at this release page, you can see the push websocket MESSAGE sent to the client.
    Examples of these MESSAGE messages can be seen in picture 3 (below).
 

Picture 1:

 

 

Picture 2:

 

 

Picture 3: 

 

 

If you instead receive a ws message that looks like the graphic shown in picture 4 (below), this indicates that the WebSocket protocol is being blocked somewhere between the client browser and CDD Tomcat server.

 

Picture 4:

 

In this case, if you were to save the Chrome developer tools output to a .har file (right click on the ws name, on the left, and select "Save all as HAR with content") and review the data in that .har file you may see something like the following - which also indicates that the WebSocket protocol is being blocked somewhere between the client browser and CDD Tomcat server.

============================================
        "request": {
          "method": "GET",
          "url": "wss://<cddServername>/cdd/websocket/ws",
          "httpVersion": "",
          "headers": [
            {
              "name": "Origin",
              "value": "<http|https>://cddServername>"
            },
            {
              "name": "Host",
              "value": "<cddServername>"
            }
          ],
          "queryString": [],
          "cookies": [],
          "headersSize": -1,
          "bodySize": 0
        },
        "response": {
          "status": 0,
          "statusText": "",
          "httpVersion": "",
          "headers": [],
          "cookies": [],
          "content": {
            "size": 0,
            "mimeType": "x-unknown"
          },
          "redirectURL": "",
          "headersSize": -1,
          "bodySize": -1,
          "_transferSize": 0,
          "_error": null
        }
============================================
 
 
Vs. a connection that is successful which looks similar to this:
============================================
        "request": {
          "method": "GET",
          "url": "ws://<cddServername>/cdd/websocket/ws",
          "httpVersion": "HTTP/1.1",
          "headers": [
            {
              "name": "Pragma",
              "value": "no-cache"
            },
            {
              "name": "Origin",
              "value": "<http|https://cddServername>"
            },
            {
              "name": "Host",
              "value": "<cddServername>"
            },
            {
              "name": "Sec-WebSocket-Key",
              "value": "TYIfyAuse3zbRlcExwRy9g=="
            },
            {
              "name": "Upgrade",
              "value": "websocket"
            },
            {
              "name": "Sec-WebSocket-Extensions",
              "value": "permessage-deflate; client_max_window_bits"
            },
            {
              "name": "Cache-Control",
              "value": "no-cache"
            },
            {
              "name": "Connection",
              "value": "Upgrade"
            },
            {
              "name": "Sec-WebSocket-Version",
              "value": "13"
            },
            {
              "name": "Sec-WebSocket-Protocol",
              "value": "v10.stomp, v11.stomp, v12.stomp"
            }
          ],
          "queryString": [],
          "cookies": [],
          "headersSize": 917,
          "bodySize": 0
        },
        "response": {
          "status": 101,
          "statusText": "",
          "httpVersion": "HTTP/1.1",
          "headers": [
            {
              "name": "hostname",
              "value": "<cddServername>"
            },
            {
              "name": "Sec-WebSocket-Protocol",
              "value": "v10.stomp"
            },
            {
              "name": "Connection",
              "value": "upgrade"
            },
            {
              "name": "Sec-WebSocket-Extensions",
              "value": "permessage-deflate;client_max_window_bits=15"
            },
            {
              "name": "Upgrade",
              "value": "websocket"
            },
            {
              "name": "Access-Control-Allow-Origin",
              "value": "<http|https>://<cddServername>"
            },
            {
              "name": "Sec-WebSocket-Accept",
              "value": "QSozBls4MPxaJnpT8RNYaUBr7rA="
            }
          ],
          "cookies": [],
          "content": {
            "size": 0,
            "mimeType": "x-unknown",
            "compression": 896
          },
          "redirectURL": "",
          "headersSize": 896,
          "bodySize": -896,
          "_transferSize": 0,
          "_error": null
        }
============================================
 
 
 

Attachments