Error with websocket connection - 500: Request header too large
search cancel

Error with websocket connection - 500: Request header too large

book

Article ID: 232382

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

We got the following error after creating a web-socket connection:

com.l7tech.external.assertions.websocket.server.WebSocketOutboundHandler: Attempting to create WebSocket connection to: ws://<HostName:Port>/api/push?access_token=<TokenValue>

com.l7tech.external.assertions.websocket.server.WebSocketOutboundHandler: There was an error creating websocket connection
java.util.concurrent.ExecutionException: org.eclipse.jetty.websocket.api.UpgradeException: 0 null

Caused by: org.eclipse.jetty.http.BadMessageException: 500: Request header too large

Environment

Release : 10 CR04

Component : API Gateway, Websocket

Cause

WebSocketAssertion uses Jetty for both inbound and outbound implementation. WebSocket client (outbound) has the default request buffer size of 4096 bytes. When the original connection upgrade request (url + headers) doesn't fit in it, it fails with the following error message

org.eclipse.jetty.http.BadMessageException: 500: Request header too large

Resolution

To solve this, a change is made to configure the WebSocket client for request buffer size in CR04 of Gateway 10. Please refer to DE507160 on the below release notes link:


https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-gateway/10-0/release-notes/resolved-issues.html

Corrected an issue that caused the connection upgrade request to fail if the request was too long to fit in a request buffer.
Introduced the following cluster properties to configure request buffer size and response buffer size for the WebSocket outbound client:

  • websocket.outbound.requestBufferSize
  • websocket.outbound.responseBufferSize

You need to increase the above buffer size as outlined in the link below and restart the Gateway service.


https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-gateway/10-0/reference/gateway-cluster-properties/websocket-cluster-properties.html