{"record":{"id":"620626898225d2d8","repo":"thanos-io/thanos","slug":"not-ready-620626","errorCode":null,"errorMessage":"not ready","messagePattern":"not ready","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/thanos/rule.go","lineNumber":793,"sourceCode":"\t\t\t\t\t\tSupportsSharding:             true,\n\t\t\t\t\t\tSupportsWithoutReplicaLabels: true,\n\t\t\t\t\t\tTsdbInfos:                    tsdbStore.TSDBInfos(),\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\t\t\t\treturn nil, errors.New(\"Not ready\")\n\t\t\t}),\n\t\t\tinfo.WithStatusInfoFunc(),\n\t\t)\n\t\tstoreServer := store.NewLimitedStoreServer(store.NewInstrumentedStoreServer(reg, tsdbStore), reg, conf.storeRateLimits)\n\t\toptions = append(options, grpcserver.WithServer(store.RegisterStoreServer(storeServer, logger)))\n\n\t\t// Add Status server for TSDB statistics\n\t\tstatusSrv := status.NewServer(\n\t\t\tcomponent.Rule.String(),\n\t\t\tstatus.WithTSDBStatisticsGetter(\n\t\t\t\tstatus.TSDBStatisticsGetterFunc(func(limit int, matchers []storepb.LabelMatcher) (map[string]tsdb.Stats, error) {\n\t\t\t\t\tif !httpProbe.IsReady() {\n\t\t\t\t\t\treturn nil, errors.New(\"not ready\")\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if external labels match the provided matchers.\n\t\t\t\t\textLabels := conf.lset\n\t\t\t\t\tpromMatchers, err := storepb.MatchersToPromMatchers(matchers...)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, errors.Wrap(err, \"failed to convert matchers\")\n\t\t\t\t\t}\n\t\t\t\t\tfor _, matcher := range promMatchers {\n\t\t\t\t\t\tif !matcher.Matches(extLabels.Get(matcher.Name)) {\n\t\t\t\t\t\t\t// External labels don't match, return empty result.\n\t\t\t\t\t\t\treturn nil, nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstats := tsdbDB.Head().Stats(labels.MetricName, limit)\n\t\t\t\t\treturn map[string]tsdb.Stats{\n\t\t\t\t\t\t\"\": *stats,","sourceCodeStart":775,"sourceCodeEnd":811,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/rule.go#L775-L811","documentation":"The Status gRPC server's TSDB statistics getter returns errors.New(\"not ready\") when the rule component's HTTP readiness probe (httpProbe.IsReady()) is still false. Any TSDBStats RPC issued before the component reports ready fails with this error instead of computing stats.","triggerScenarios":"A client calls the TSDB status/statistics RPC while the rule component is starting up or has been marked not ready (e.g. during a failed reload that set the probe unhealthy).","commonSituations":"Opening the Thanos UI/bucket status page right after pod restart; monitoring tooling polling the status API before readiness; component stuck not-ready due to a config reload failure.","solutions":["Wait for /-/ready to return OK, then retry the status request.","If it persists, check logs for the underlying reason the probe is not ready (failed rule reload, TSDB issues).","Add retry/backoff around status API calls in automation.","Fix the failed reload (e.g. invalid rule file from error 139) so the component becomes ready."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"await fetch('http://rule:10902/-/ready').then(r => r.ok)","typeGuard":null,"tryCatchPattern":"try { stats = await statusClient.TSDBStats(req) } catch (e) { if (String(e).includes('not ready')) { await waitForReady(); return retry() } throw e }","preventionTips":["Poll /-/ready before calling status APIs","Fix underlying not-ready causes (failed reloads) promptly","Add retry/backoff in dashboards and automation"],"tags":["grpc","readiness","status","startup"],"backgroundTag":"service-not-ready","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"}