{"record":{"id":"2a87400f84da6ac1","repo":"grpc/grpc-go","slug":"lrs-invalid-load-reporting-interval-v","errorCode":null,"errorMessage":"lrs: invalid load_reporting_interval: %v","messagePattern":"lrs: invalid load_reporting_interval: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/xds/clients/lrsclient/lrs_stream.go","lineNumber":222,"sourceCode":"func (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\n\tclusters := resp.Clusters\n\tif resp.SendAllClusters {\n\t\t// Return an empty slice to send stats for all clusters.\n\t\tclusters = []string{}\n\t}\n\n\treturn clusters, loadReportingInterval, nil\n}\n\nfunc (lrs *streamImpl) sendLoadStatsRequest(stream clients.Stream, loads []*loadData) error {\n\tclusterStats := make([]*v3endpointpb.ClusterStats, 0, len(loads))\n\tfor _, sd := range loads {\n\t\tdroppedReqs := make([]*v3endpointpb.ClusterStats_DroppedRequests, 0, len(sd.drops))\n\t\tfor category, count := range sd.drops {\n\t\t\tdroppedReqs = append(droppedReqs, &v3endpointpb.ClusterStats_DroppedRequests{","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/grpc/grpc-go/blob/0c51461d27177d997e14c642fe18c11668fc09a3/internal/xds/clients/lrsclient/lrs_stream.go#L204-L240","documentation":"Returned by recvFirstLoadStatsResponse when resp.LoadReportingInterval fails timestamp validation (lrs_stream.go:222). The LRS response must carry a valid duration; if it is absent or malformed the client cannot cadence its reports. Note: the message formats the previously-nil `err` variable, so the underlying CheckValid error is not surfaced in the text - the message is effectively a fixed string.","triggerScenarios":"Server sends a LoadStatsResponse where load_reporting_interval is unset or contains an invalid duration. internal := resp.GetLoadReportingInterval(); internal.CheckValid() != nil triggers the branch.","commonSituations":"Misconfigured LRS server omits the interval; server sends a zero or negative duration; proto schema mismatch causes the field to deserialize as zero.","solutions":["Server-side: ensure LoadStatsResponse.load_reporting_interval is set to a positive, valid duration (e.g. 1s-60s).","Upgrade or patch the LRS server to a version known to populate the interval.","If the server is Envoy, check the lrs_config / load_stats_config cluster settings."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure the LRS server to always send a positive load_reporting_interval.","Integration-test the server response shape against the v3 LRS proto.","If you control the server, add a unit test that the response always populates the interval."],"tags":["lrs","xds","configuration","protobuf","server-bug"],"backgroundTag":null,"analyzedSha":"0c51461d27177d997e14c642fe18c11668fc09a3","analyzedAt":"2026-08-11T14:49:15.055Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}