High rate of client_disconnected_before_any_response errors

Problem

High rate of client_disconnected_before_any_response errors returned by external HTTP(S) load balancer.

Environment

  • External HTTPs load balancer

Solution

  1. Contact Google Cloud support to disable HTTP/2 for the load balancer VIP.

Cause

There is a bug that is seen often with Android clients, if the client is using OkHttp and connecting using HTTP/2. You can see the public issue here. Issue are found in OkHttp3 and OkHttp4.

As explained in the documentation, the error code indicates that the connection to the client was broken before the load balancer sent any response.

Before filing a support case, confirm that backend_service_name: ""  for the logs that are returning the error using the following query:

resource.type="http_load_balancer"
resource.labels.forwarding_rule_name="(FORWARDING_RULE_NAME)"
resource.labels.url_map_name="(URL_MAP_NAME)"
httpRequest.status=0
jsonPayload.statusDetails="client_disconnected_before_any_response"