{"record":{"id":"6af4d944ad0a643e","repo":"thanos-io/thanos","slug":"not-supported-remote-read-content-type-s","errorCode":null,"errorMessage":"not supported remote read content type: %s","messagePattern":"not supported remote read content type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/store/prometheus.go","lineNumber":217,"sourceCode":"\n\tqueryPrometheusSpan, ctx := tracing.StartSpan(s.Context(), \"query_prometheus\")\n\tqueryPrometheusSpan.SetTag(\"query.request\", q.String())\n\n\thttpResp, err := p.startPromRemoteRead(ctx, q)\n\tif err != nil {\n\t\tqueryPrometheusSpan.Finish()\n\t\treturn errors.Wrap(err, \"query Prometheus\")\n\t}\n\n\t// Negotiate content. We requested streamed chunked response type, but still we need to support old versions of\n\t// remote read.\n\tcontentType := httpResp.Header.Get(\"Content-Type\")\n\tif strings.HasPrefix(contentType, \"application/x-protobuf\") {\n\t\treturn p.handleSampledPrometheusResponse(s, httpResp, queryPrometheusSpan, extLset, enableChunkHashCalculation, extLsetToRemove)\n\t}\n\n\tif !strings.HasPrefix(contentType, \"application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse\") {\n\t\treturn errors.Errorf(\"not supported remote read content type: %s\", contentType)\n\t}\n\treturn p.handleStreamedPrometheusResponse(s, shardMatcher, httpResp, queryPrometheusSpan, extLset, enableChunkHashCalculation, extLsetToRemove)\n}\n\nfunc (p *PrometheusStore) handleSampledPrometheusResponse(\n\ts flushableServer,\n\thttpResp *http.Response,\n\tquerySpan tracing.Span,\n\textLset labels.Labels,\n\tcalculateChecksums bool,\n\textLsetToRemove map[string]struct{},\n) error {\n\tlevel.Debug(p.logger).Log(\"msg\", \"started handling ReadRequest_SAMPLED response type.\")\n\n\tresp, err := p.fetchSampledResponse(s.Context(), httpResp)\n\tquerySpan.Finish()\n\tif err != nil {\n\t\treturn err","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/store/prometheus.go#L199-L235","documentation":"After receiving the remote-read HTTP response, Series inspects Content-Type. Only 'application/x-protobuf' (sampled) and 'application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse' (streamed chunks) are supported; anything else errors with 'not supported remote read content type'.","triggerScenarios":"The remote-read endpoint replies with a Content-Type other than the two supported ones — e.g. an intermediary, proxy, or gateway rewriting responses, or an endpoint that is not a real Prometheus remote-read handler.","commonSituations":"Pointing the store at the wrong URL (e.g. /api/v1/query or an HTML error page from a proxy), an auth layer returning JSON errors, or a Prometheus-compatible service with a different remote-read implementation.","solutions":["Check the Content-Type your endpoint actually returns for /api/v1/read (curl -i).","Fix the configured remote-read URL to point at the real Prometheus remote-read endpoint.","Bypass/remove proxies or auth middlewares that alter the response body/headers, or make them pass the upstream Content-Type through.","Upgrade the target Prometheus if its remote read lacks the streamed chunked content type and you require streaming."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"resp, err := http.Head(remoteReadURL)\nif err != nil { return err }\nct := resp.Header.Get(\"Content-Type\")\nif ct != \"application/x-protobuf\" && !strings.HasPrefix(ct, \"application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse\") {\n    return fmt.Errorf(\"endpoint content type %q not supported\", ct)\n}","typeGuard":null,"tryCatchPattern":"if err := s.Series(ctx, req); err != nil {\n    if strings.Contains(err.Error(), \"not supported remote read content type\") {\n        // inspect returned Content-Type; fix endpoint/URL or disable streaming negotiation\n    }\n    return err\n}","preventionTips":["Verify the endpoint is the real Prometheus remote-read handler, not a proxy/error page.","curl -i the /api/v1/read endpoint and check Content-Type before wiring it up.","Keep Prometheus recent enough for the streamed chunked content type.","Configure proxies to pass through upstream Content-Type headers."],"tags":["prometheus","remote-read","content-type","http"],"backgroundTag":"unsupported-media-type","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"}