{"record":{"id":"64596affd56b7a21","repo":"thanos-io/thanos","slug":"sending-metadata-warning-to-server-v","errorCode":null,"errorMessage":"sending metadata warning to server %v","messagePattern":"sending metadata warning to server (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/metadata/proxy.go","lineNumber":143,"sourceCode":"\t\t}\n\n\t\tif err != nil {\n\t\t\terr = errors.Wrapf(err, \"receiving metric metadata from metadata 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(metadatapb.NewWarningMetadataResponse(err)); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"sending metadata 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(metadatapb.NewWarningMetadataResponse(errors.New(w))); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"sending metadata 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.GetMetadata():\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\t}\n\t}\n}\n","sourceCodeStart":125,"sourceCodeEnd":156,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/metadata/proxy.go#L125-L156","documentation":"When the upstream response carries a warning, the proxy forwards it as a warning metadata response; if that forward Send fails it is wrapped with 'sending metadata warning to server %v'. The warning itself could not be delivered to the caller.","triggerScenarios":"stream.server.Send of a warning response fails — the downstream client stream is closed, canceled, or the connection broke.","commonSituations":"Client cancels a PxL metadata query while warnings are being forwarded; idle timeout closes the client gRPC stream mid-response.","solutions":["Check whether the client canceled (context.Canceled/gRPC Canceled) — this is benign","Ensure the client keeps the stream open until it has read all responses","Investigate client-side network stability if this recurs without cancelation","Log the underlying warning content so the intended warning is not lost"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := stream.ServerSend(warnResp); err != nil {\n    if status.Code(err) == codes.Canceled {\n        return nil // client gone; warning undeliverable\n    }\n    return err\n}","preventionTips":["Keep clients connected until stream EOF","Log warning content before attempting to forward it","Avoid aggressive client-side timeouts on long metadata queries"],"tags":["grpc","streaming","warning"],"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"}