{"record":{"id":"3bdb7b5fb825cda3","repo":"thanos-io/thanos","slug":"downstream-url-s-returned-an-error-d","errorCode":null,"errorMessage":"downstream URL %s returned an error: %d","messagePattern":"downstream URL (.+?) returned an error: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/query_frontend.go","lineNumber":426,"sourceCode":"\n\t\t\tdoCheckDownstream := func() (rerr error) {\n\t\t\t\ttimeoutCtx, cancel := context.WithTimeout(ctx, 10*time.Second)\n\t\t\t\tdefer cancel()\n\n\t\t\t\treadinessUrl := cfg.DownstreamURL + \"/-/ready\"\n\t\t\t\treq, err := http.NewRequestWithContext(timeoutCtx, http.MethodGet, readinessUrl, nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrap(err, \"creating request to downstream URL\")\n\t\t\t\t}\n\n\t\t\t\tresp, err := downstreamRT.RoundTrip(req)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrapf(err, \"roundtripping to downstream URL %s\", readinessUrl)\n\t\t\t\t}\n\t\t\t\tdefer runutil.CloseWithErrCapture(&rerr, resp.Body, \"downstream health check response body\")\n\n\t\t\t\tif resp.StatusCode/100 == 4 || resp.StatusCode/100 == 5 {\n\t\t\t\t\treturn errors.Errorf(\"downstream URL %s returned an error: %d\", readinessUrl, resp.StatusCode)\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tfor {\n\t\t\t\tif !firstRun {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t\treturn nil\n\t\t\t\t\tcase <-time.After(10 * time.Second):\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfirstRun = false\n\n\t\t\t\tif err := doCheckDownstream(); err != nil {\n\t\t\t\t\tstatusProber.NotReady(err)\n\t\t\t\t} else {\n\t\t\t\t\tstatusProber.Ready()","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/query_frontend.go#L408-L444","documentation":"The downstream readiness check received a non-success HTTP response from <downstreamURL>/-/ready; the downstream query service reports it is not healthy or the request failed, so the frontend will keep probing until ready.","triggerScenarios":"Thrown at cmd/thanos/query_frontend.go:426 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait until the downstream query instance finishes starting up","Inspect downstream logs for startup/health failures","Verify the downstream URL is correct","Check for proxy/load-balancer interference with /-/ready"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}