thanos-io/thanos · error

receiving rules from rules client

Error message

receiving rules from rules client %v

What it means

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.

Solutions

  1. Check upstream store health and gRPC stream limits
  2. Investigate the wrapped Recv error (transport reset, context deadline)
  3. Retry the request; do not attempt to continue reading the aborted stream
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/rules/proxy.go:129 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07). Data as JSON: /api/errors/326b57b83b2c0674. Report an issue: GitHub.

Appendix: source

Thrown at pkg/rules/proxy.go:129

		if serr := stream.server.Send(rulespb.NewWarningRulesResponse(err)); serr != nil {
			return serr
		}
		// Not an error if response strategy is warning.
		return nil
	}

	for {
		rule, err := rules.Recv()
		if err == io.EOF {
			return nil
		}

		if err != nil {
			// An error happened in Recv(), hence the underlying stream is aborted
			// as per https://github.com/grpc/grpc-go/blob/7f2581f910fc21497091c4109b56d310276fc943/stream.go#L117-L125.
			// We must not continue receiving additional data from it and must return.
			err = errors.Wrapf(err, "receiving rules from rules client %v", stream.client)

			if stream.request.PartialResponseStrategy == storepb.PartialResponseStrategy_ABORT {
				return err
			}

			if err := stream.server.Send(rulespb.NewWarningRulesResponse(err)); err != nil {
				return errors.Wrapf(err, "sending rules error to server %v", stream.server)
			}

			// Return no error if response strategy is warning.
			return nil
		}

		if w := rule.GetWarning(); w != "" {
			if err := stream.server.Send(rulespb.NewWarningRulesResponse(errors.New(w))); err != nil {
				return errors.Wrapf(err, "sending rules warning to server %v", stream.server)
			}
			// Client stream is not aborted, it is ok to receive additional data.

View on GitHub (pinned to 35b8b99117)