{"record":{"id":"cc7926bd9f6e4455","repo":"thanos-io/thanos","slug":"roundtripping-to-downstream-url-s","errorCode":null,"errorMessage":"roundtripping to downstream URL %s","messagePattern":"roundtripping to downstream URL (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/query_frontend.go","lineNumber":421,"sourceCode":"\t{\n\t\tctx, cancel := context.WithCancel(context.Background())\n\n\t\tg.Add(func() error {\n\t\t\tvar firstRun = true\n\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","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/query_frontend.go#L403-L439","documentation":"The periodic downstream readiness probe's HTTP RoundTrip against <downstreamURL>/-/ready failed, meaning the query-frontend cannot reach the downstream query service (network error, DNS failure, TLS problem, or timeout).","triggerScenarios":"Thrown at cmd/thanos/query_frontend.go:421 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the downstream URL flag points to a reachable query instance","Check network/DNS/firewall between frontend and downstream","Confirm downstream is running and /-/ready responds","Check TLS configuration on both sides"],"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"}