{"record":{"id":"5af45ea27456cfca","repo":"thanos-io/thanos","slug":"sending-targets-warning-to-server-v","errorCode":null,"errorMessage":"sending targets warning to server %v","messagePattern":"sending targets warning to server (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/targets/proxy.go","lineNumber":128,"sourceCode":"\t\t}\n\n\t\tif err != nil {\n\t\t\terr = errors.Wrapf(err, \"receiving targets from targets 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(targetspb.NewWarningTargetsResponse(err)); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"sending targets error to server %v\", stream.server)\n\t\t\t}\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 := target.GetWarning(); w != \"\" {\n\t\t\tif err := stream.server.Send(targetspb.NewWarningTargetsResponse(errors.New(w))); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"sending targets 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 <- target.GetTargets():\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\t}\n\t}\n}\n","sourceCodeStart":110,"sourceCodeEnd":140,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/targets/proxy.go#L110-L140","documentation":"This error is thrown when the proxy tries to relay a warning received from an upstream target response to the downstream gRPC server, and that Send call itself fails. The upstream sent a Target with a Warning field; relaying it as a WarningTargetsResponse failed.","triggerScenarios":"In receive(), target.GetWarning() is non-empty and stream.server.Send(targetspb.NewWarningTargetsResponse(...)) fails due to a broken/canceled downstream stream.","commonSituations":"Query client disconnected or timed out exactly when a warning (e.g. partial results from one sidecar) was being forwarded; LB idle timeout killing the stream.","solutions":["Check the wrapped cause; typically context canceled — trace which caller dropped the stream.","Increase query/client timeouts so the stream stays open until warnings are delivered.","Verify network paths (ingress gateways) are not closing gRPC streams prematurely; raise idle timeouts.","Treat as noise during client shutdown; filter by errors.Is(err, context.Canceled) in logs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := stream.server.Send(warningResp); err != nil {\n    log.Warn(\"failed to relay targets warning\", zap.Error(err))\n    return nil // do not mask original warning\n}","preventionTips":["Raise client query timeouts so warning relay completes","Monitor stream cancelation rates","Configure ingress to support long-lived gRPC streams"],"tags":["grpc","streaming","warning-relay","thanos-targets"],"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"}