{"record":{"id":"77ea33289e58eb28","repo":"thanos-io/thanos","slug":"no-storeapis-available","errorCode":null,"errorMessage":"No StoreAPIs available","messagePattern":"No StoreAPIs available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/store/proxy.go","lineNumber":53,"sourceCode":"\t\"github.com/thanos-io/thanos/pkg/tenancy\"\n)\n\ntype ctxKey int\n\n// UninitializedTSDBTime is the TSDB start time of an uninitialized TSDB instance.\nconst UninitializedTSDBTime = math.MaxInt64\n\n// StoreMatcherKey is the context key for the store's allow list.\nconst StoreMatcherKey = ctxKey(0)\n\n// ErrorNoStoresMatched is returned if the query does not match any data.\n// This can happen with Query servers trees and external labels.\nvar ErrorNoStoresMatched = errors.New(\"No StoreAPIs matched for this query\")\n\n// ErrorNoStoresAvailable is returned if we have an empty list of stores.\n// This happens either when we didn't yet complete any discovery\n// or when all stores disappear suddenly.\nvar ErrorNoStoresAvailable = errors.New(\"No StoreAPIs available\")\n\n// Client holds meta information about a store.\ntype Client interface {\n\t// StoreClient to access the store.\n\tstorepb.StoreClient\n\n\t// LabelSets that each apply to some data exposed by the backing store.\n\tLabelSets() []labels.Labels\n\n\t// TimeRange returns minimum and maximum time range of data in the store.\n\tTimeRange() (mint int64, maxt int64)\n\n\t// TSDBInfos returns metadata about each TSDB backed by the client.\n\tTSDBInfos() []infopb.TSDBInfo\n\n\t// SupportsSharding returns true if sharding is supported by the underlying store.\n\tSupportsSharding() bool\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/store/proxy.go#L35-L71","documentation":"ErrorNoStoresAvailable is a sentinel error returned when the proxy's store discovery produced an empty store list and the request cannot tolerate it (PartialResponseDisabled or ABORT strategy). It means discovery has not completed yet or all stores have disappeared, so the query cannot be served at all.","triggerScenarios":"Series called on a proxy Store immediately after startup before registry/servicediscovery populated stores, or after all stores were removed/unregistered, while running in ABORT or partial-response-disabled mode.","commonSituations":"Thanos Query starting up and receiving queries before endpoint discovery finishes; all StoreAPI endpoints unhealthy/deregistered from gossip/DNS; misconfigured service discovery yielding zero endpoints.","solutions":["Retry the query after discovery completes (or wait for readiness endpoints before routing traffic)","Verify store endpoints are registered and healthy (DNS, k8s services, gossip membership)","If empty results are acceptable, use PartialResponseStrategy_ALLOWED so an empty store list doesn't fail the query","Check store service discovery configuration (static addresses, file_sd, kubernetes SD) for typos"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// check discovery readiness before sending queries\nif storeClient.Ready() == false { return errors.New(\"store discovery not complete; retry later\") }","typeGuard":null,"tryCatchPattern":"resp, err := queryClient.Series(ctx, req)\nif err != nil && strings.Contains(err.Error(), ErrorNoStoresAvailable.Error()) {\n    // wait/backoff and retry once discovery completes\n    time.Sleep(retryDelay)\n    resp, err = queryClient.Series(ctx, req)\n}","preventionTips":["Gate traffic on the query readiness endpoint after startup","Monitor registered store count and alert on zero-store conditions","Use PartialResponseStrategy_ALLOWED if queries may legitimately run with no stores","Verify service discovery (DNS/k8s/gossip) yields at least one healthy endpoint"],"tags":["thanos","store-discovery","query","availability"],"backgroundTag":"empty-result-set","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"}