{"record":{"id":"a80edc79b7a7c55a","repo":"thanos-io/thanos","slug":"cannot-obtain-metadata-neither-info-nor-store-cli","errorCode":null,"errorMessage":"cannot obtain metadata: neither info nor store client found","messagePattern":"cannot obtain metadata: neither info nor store client found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/query/endpointset.go","lineNumber":90,"sourceCode":"func (es *GRPCEndpointSpec) Addr() string {\n\t// API address should not change between state changes.\n\treturn es.addr\n}\n\n// Metadata method for gRPC endpoint tries to call InfoAPI exposed by Thanos components until context timeout. If we are unable to get metadata after\n// that time, we assume that the host is unhealthy and return error.\nfunc (es *endpointRef) Metadata(ctx context.Context, infoClient infopb.InfoClient, storeClient storepb.StoreClient) (*endpointMetadata, error) {\n\tif infoClient != nil {\n\t\tresp, err := infoClient.Info(ctx, &infopb.InfoRequest{}, grpc.WaitForReady(true))\n\t\tif err != nil {\n\t\t\tif status.Convert(err).Code() != codes.Unimplemented {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\treturn &endpointMetadata{resp}, nil\n\t\t}\n\t}\n\treturn nil, errors.New(noMetadataEndpointMessage)\n}\n\n// stringError forces the error to be a string\n// when marshaled into a JSON.\ntype stringError struct {\n\toriginalErr error\n}\n\n// MarshalJSON marshals the error into a string form.\nfunc (e *stringError) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(e.originalErr.Error())\n}\n\n// Error returns the original underlying error.\nfunc (e *stringError) Error() string {\n\treturn e.originalErr.Error()\n}\n","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/query/endpointset.go#L72-L108","documentation":"In pkg/query EndpointSet metadata collection, after trying the /metadata endpoint and gRPC store-info paths, the code returns errors.New(noMetadataEndpointMessage) — \"cannot obtain metadata: neither info nor store client found\" — when an endpoint provides neither a StoreClient (gRPC store API) nor a working HTTP metadata endpoint. updateEndpoint records this as the endpoint's lastError.","triggerScenarios":"Endpoint is registered in the EndpointSet but the gRPC StoreClient is unavailable (spec has no store API support) and the HTTP /metadata or /-/ endpoints fail or are absent (e.g. non-Thanos HTTP endpoint, or Sidecar/O storeAPI nil).","commonSituations":"Adding an HTTP-only endpoint (e.g. plain Prometheus URL without Thanos storeAPI); sidecar version too old to expose StoreAPI; endpoint URL typed wrong so /metadata 404s; mixing node types in --endpoint flag.","solutions":["Ensure each endpoint in the endpointset actually exposes a Thanos StoreAPI (gRPC) or a valid Thanos HTTP metadata endpoint.","Upgrade sidecar/store components to a version that serves the StoreAPI (/store API or storepb).","Verify endpoint addressing and paths; curl the /metadata endpoint to confirm it responds.","Remove or fix endpoints that are not Thanos store nodes from the endpoint configuration."],"exampleFix":"// before\n// endpoint registered with only an HTTP address, no store API\nEndpointSet{ Endpoints: []string{\"http://prometheus:9090\"} }\n\n// after\n// register the Thanos Sidecar StoreAPI gRPC endpoint instead\nEndpointSet{ Endpoints: []string{\"sidecar.example:10901\"} }","handlingStrategy":"validation","validationCode":"// before adding an endpoint, verify it serves metadata or store API\nresp, err := http.Get(endpointURL + \"/metadata\")\nif err != nil || resp.StatusCode != http.StatusOK {\n\treturn fmt.Errorf(\"endpoint %s lacks metadata endpoint; ensure it exposes Thanos StoreAPI\", endpointURL)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Register only Thanos components exposing StoreAPI or /metadata in endpoint sets","Check component versions support the StoreAPI before wiring","Verify endpoint addresses resolve to Thanos sidecars/queriers, not plain Prometheus"],"tags":["thanos","grpc","metadata","endpoint"],"backgroundTag":"resource-not-found","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"}