{"record":{"id":"036e7efe17671af4","repo":"grpc/grpc-go","slug":"lrs-failed-to-receive-first-loadstatsresponse-v","errorCode":null,"errorMessage":"lrs: failed to receive first LoadStatsResponse: %v","messagePattern":"lrs: failed to receive first LoadStatsResponse: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/xds/clients/lrsclient/lrs_stream.go","lineNumber":207,"sourceCode":"\t\treturn err\n\t}\n\terr = stream.Send(msg)\n\tif err == io.EOF {\n\t\treturn getStreamError(stream)\n\t}\n\treturn err\n}\n\n// recvFirstLoadStatsResponse receives the first LoadStatsResponse from the LRS\n// server.  Returns the following:\n//   - a list of cluster names requested by the server or an empty slice if the\n//     server requested for load from all clusters\n//   - the load reporting interval, and\n//   - any error encountered\nfunc (lrs *streamImpl) recvFirstLoadStatsResponse(stream clients.Stream) ([]string, time.Duration, error) {\n\tr, err := stream.Recv()\n\tif err != nil {\n\t\treturn nil, 0, fmt.Errorf(\"lrs: failed to receive first LoadStatsResponse: %v\", err)\n\t}\n\tvar resp v3lrspb.LoadStatsResponse\n\tif err := proto.Unmarshal(r, &resp); err != nil {\n\t\tif lrs.logger.V(2) {\n\t\t\tlrs.logger.Infof(\"Failed to unmarshal response to LoadStatsResponse: %v\", err)\n\t\t}\n\t\treturn nil, time.Duration(0), fmt.Errorf(\"lrs: unexpected message type %T\", r)\n\t}\n\tif lrs.logger.V(perRPCVerbosityLevel) {\n\t\tlrs.logger.Infof(\"Received first LoadStatsResponse: %s\", pretty.ToJSON(&resp))\n\t}\n\n\tinternal := resp.GetLoadReportingInterval()\n\tif internal.CheckValid() != nil {\n\t\treturn nil, 0, fmt.Errorf(\"lrs: invalid load_reporting_interval: %v\", err)\n\t}\n\tloadReportingInterval := internal.AsDuration()\n","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/grpc/grpc-go/blob/0c51461d27177d997e14c642fe18c11668fc09a3/internal/xds/clients/lrsclient/lrs_stream.go#L189-L225","documentation":"Returned by recvFirstLoadStatsResponse when the first stream.Recv() on the LRS stream fails (lrs_stream.go:207). The runner logs it as a warning and retries with backoff, so this is a transient/recoverable condition rather than a fatal one.","triggerScenarios":"The LRS server closes the StreamLoadStats stream before sending any LoadStatsResponse, or the underlying transport fails (TLS error, RST_STREAM, context cancel, deadline). The first Recv after sending the initial LoadStatsRequest returns a non-nil error.","commonSituations":"LRS server is not actually an LRS server (wrong URI); server rejects the node identity; TLS handshake to the LRS server fails; intermediate proxy times out idle streams; server-side bug drops the stream on first message.","solutions":["Check connectivity and TLS to the LRS server independently (grpcurl, openssl s_client).","Confirm the target URI is an LRS-enabled endpoint (envoy.service.load_stats.v3.LoadReportingService).","Raise gRPC verbosity to see the wrapped transport error and act on it.","If transient, rely on the built-in exponential backoff - the runner will reconnect automatically."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Rely on the LRS runner's built-in exponential backoff - it reconnects automatically.","Pre-validate TLS and connectivity to the LRS server before starting ReportLoad.","Set GRPC_VERBOSITY and Component(xds) logging to capture the wrapped transport error."],"tags":["lrs","xds","network","stream","retry"],"backgroundTag":null,"analyzedSha":"0c51461d27177d997e14c642fe18c11668fc09a3","analyzedAt":"2026-08-11T14:49:15.055Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}