{"record":{"id":"326b57b83b2c0674","repo":"thanos-io/thanos","slug":"receiving-rules-from-rules-client-v","errorCode":null,"errorMessage":"receiving rules from rules client %v","messagePattern":"receiving rules from rules client (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/rules/proxy.go","lineNumber":129,"sourceCode":"\n\t\tif serr := stream.server.Send(rulespb.NewWarningRulesResponse(err)); serr != nil {\n\t\t\treturn serr\n\t\t}\n\t\t// Not an error if response strategy is warning.\n\t\treturn nil\n\t}\n\n\tfor {\n\t\trule, err := rules.Recv()\n\t\tif err == io.EOF {\n\t\t\treturn nil\n\t\t}\n\n\t\tif err != nil {\n\t\t\t// An error happened in Recv(), hence the underlying stream is aborted\n\t\t\t// as per https://github.com/grpc/grpc-go/blob/7f2581f910fc21497091c4109b56d310276fc943/stream.go#L117-L125.\n\t\t\t// We must not continue receiving additional data from it and must return.\n\t\t\terr = errors.Wrapf(err, \"receiving rules from rules 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(rulespb.NewWarningRulesResponse(err)); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"sending rules error to server %v\", stream.server)\n\t\t\t}\n\n\t\t\t// Return no error if response strategy is warning.\n\t\t\treturn nil\n\t\t}\n\n\t\tif w := rule.GetWarning(); w != \"\" {\n\t\t\tif err := stream.server.Send(rulespb.NewWarningRulesResponse(errors.New(w))); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"sending rules warning to server %v\", stream.server)\n\t\t\t}\n\t\t\t// Client stream is not aborted, it is ok to receive additional data.","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/rules/proxy.go#L111-L147","documentation":"Raised in rulesStream.receive when rules.Recv() on the upstream rules stream returns a non-EOF error. Per gRPC stream semantics the stream is aborted and no further messages may be received, so the receive loop must return; with ABORT strategy the error propagates, otherwise it is sent downstream as a warning.","triggerScenarios":"Thrown at pkg/rules/proxy.go:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check upstream store health and gRPC stream limits","Investigate the wrapped Recv error (transport reset, context deadline)","Retry the request; do not attempt to continue reading the aborted stream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}