{"record":{"id":"a0f1703842a05f60","repo":"thanos-io/thanos","slug":"fetching-metric-metadata-from-metadata-client-v","errorCode":null,"errorMessage":"fetching metric metadata from metadata client %v","messagePattern":"fetching metric metadata from metadata client (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/metadata/proxy.go","lineNumber":108,"sourceCode":"type metricMetadataStream struct {\n\tclient  metadatapb.MetadataClient\n\trequest *metadatapb.MetricMetadataRequest\n\tchannel chan<- *metadatapb.MetricMetadata\n\tserver  metadatapb.Metadata_MetricMetadataServer\n}\n\nfunc (stream *metricMetadataStream) receive(ctx context.Context) error {\n\tvar (\n\t\terr         error\n\t\tmetadataCli metadatapb.Metadata_MetricMetadataClient\n\t)\n\n\ttracing.DoInSpan(ctx, \"receive_metadata_stream_request\", func(ctx context.Context) {\n\t\tmetadataCli, err = stream.client.MetricMetadata(ctx, stream.request)\n\t})\n\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"fetching metric metadata from metadata client %v\", stream.client)\n\n\t\tif stream.request.PartialResponseStrategy == storepb.PartialResponseStrategy_ABORT {\n\t\t\treturn err\n\t\t}\n\n\t\tif serr := stream.server.Send(metadatapb.NewWarningMetadataResponse(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\tresp, err := metadataCli.Recv()\n\t\tif err == io.EOF {\n\t\t\treturn nil\n\t\t}\n","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/metadata/proxy.go#L90-L126","documentation":"receive() opens the metadata stream to the upstream client inside a span; a failure to create/execute the MetricMetadata call is wrapped with this message naming the client. The error is either returned directly (ABORT strategy) or converted into a warning response for the caller.","triggerScenarios":"stream.client.MetricMetadata fails at stream setup — upstream unavailable, context deadline exceeded, or connection refused.","commonSituations":"Vizier metadata service down during a PxL metadata query; network outage between proxy and store; context canceled because the caller aborted.","solutions":["Check health of the upstream metadata service and its connectivity","Inspect the wrapped error for the gRPC status (unavailable, deadline exceeded, etc.) and fix accordingly","Retry with backoff if transient; with ABORT strategy the error propagates, with WARNING it is sent as a warning response","Increase request/context timeout if deadline exceeded"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify upstream reachable before querying\nconn, err := grpc.DialContext(ctx, addr, grpc.WithBlock())\nif err != nil { return errors.New(\"metadata service unreachable\") }","typeGuard":null,"tryCatchPattern":"_, err := client.MetricMetadata(ctx, req)\nif err != nil {\n    if status.Code(err) == codes.Unavailable || status.Code(err) == codes.DeadlineExceeded {\n        // retry with backoff\n    }\n}","preventionTips":["Health-check the metadata service before issuing queries","Set realistic context deadlines","Choose ABORT vs WARNING strategy deliberately based on whether partial data is acceptable"],"tags":["grpc","network","proxy"],"backgroundTag":"upstream-api-error","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"}