{"record":{"id":"1da98424d659c533","repo":"thanos-io/thanos","slug":"sending-tsdb-statistics-warning-to-server-v","errorCode":null,"errorMessage":"sending tsdb statistics warning to server %v","messagePattern":"sending tsdb statistics warning to server (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/status/proxy.go","lineNumber":139,"sourceCode":"\n\t\tif err != nil {\n\t\t\terr = errors.Wrapf(err, \"receiving tsdb statistics from status client %v\", stream.client)\n\n\t\t\tif stream.request.PartialResponseStrategy == storepb.PartialResponseStrategy_ABORT {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := stream.server.Send(statuspb.NewWarningTSDBStatisticsResponse(err)); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"sending tsdb statistics error to server %v\", stream.server)\n\t\t\t}\n\n\t\t\t// Not an error if response strategy is warning.\n\t\t\treturn nil\n\t\t}\n\n\t\tif w := resp.GetWarning(); w != \"\" {\n\t\t\tif err := stream.server.Send(statuspb.NewWarningTSDBStatisticsResponse(errors.New(w))); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"sending tsdb statistics warning to server %v\", stream.server)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tselect {\n\t\tcase stream.channel <- resp.GetStatistics():\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\t}\n\t}\n}\n","sourceCodeStart":121,"sourceCodeEnd":151,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/status/proxy.go#L121-L151","documentation":"When the upstream statistics stream sends a warning message (resp.GetWarning() non-empty), the proxy relays it to the caller. If `stream.server.Send(...)` for that warning fails, the send error is wrapped with this message. The warning content itself is upstream store chatter; the error is purely a failed delivery of it.","triggerScenarios":"receive() loop hits a warning response from the store and attempts `stream.server.Send(NewWarningTSDBStatisticsResponse(...))` while the downstream client stream is dead/cancelled.","commonSituations":"Client timeout or disconnect while stores emit warnings; many warnings from a misbehaving store; load balancer terminating long-lived streams.","solutions":["Check why the client connection to the proxy dropped (timeouts, cancellation).","Reduce warning volume by fixing the offending store that emits them.","Verify LB/proxy idle timeouts allow the full statistics stream.","Retry the request once the client connection is healthy."],"exampleFix":"// before\nclient with 5s deadline on a stream taking 15s\n// after\nctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := call(ctx); err != nil {\n    if strings.Contains(err.Error(), \"sending tsdb statistics warning to server\") {\n        logger.Debug(\"failed to relay warning to disconnected client\", \"err\", err)\n        return nil\n    }\n    return err\n}","preventionTips":["Keep client streams open until completion.","Fix stores that emit excessive warnings.","Match proxy idle timeouts to stream durations.","Treat warning-delivery failures as secondary symptoms."],"tags":["grpc","streaming","proxy","warning-delivery"],"backgroundTag":"broken-pipe","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}