{"record":{"id":"63dabff0c9e9f300","repo":"thanos-io/thanos","slug":"setup-downstream-roundtripper","errorCode":null,"errorMessage":"setup downstream roundtripper","messagePattern":"setup downstream roundtripper","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/query_frontend.go","lineNumber":336,"sourceCode":"\n\ttripperWare, err := queryfrontend.NewTripperware(cfg.Config, reg, logger)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"setup tripperwares\")\n\t}\n\n\t// Create a downstream roundtripper.\n\tdownstreamTripperConfContentYaml, err := cfg.DownstreamTripperConfig.CachePathOrContent.Content()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdownstreamTripper, err := parseTransportConfiguration(downstreamTripperConfContentYaml)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdownstreamRT, err := cortexfrontend.NewDownstreamRoundTripper(cfg.DownstreamURL, downstreamTripper)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"setup downstream roundtripper\")\n\t}\n\n\t// Wrap the downstream RoundTripper into query frontend Tripperware.\n\troundTripper := tripperWare(downstreamRT)\n\n\t// Create the query frontend transport.\n\thandler := transport.NewHandler(*cfg.CortexHandlerConfig, roundTripper, logger, nil)\n\tif cfg.CompressResponses {\n\t\thandler = gzhttp.GzipHandler(handler)\n\t}\n\n\thttpProbe := prober.NewHTTP()\n\tstatusProber := prober.Combine(\n\t\thttpProbe,\n\t\tprober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix(\"thanos_\", reg)),\n\t)\n\n\t// Configure Request Logging for HTTP calls.","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/query_frontend.go#L318-L354","documentation":"This wraps errors from cortexfrontend.NewDownstreamRoundTripper, which validates the downstream URL and builds the RoundTripper used to forward requests. Failure usually means the --query-frontend.downstream-url is invalid or not an acceptable URL for the transport.","triggerScenarios":"--query-frontend.downstream-url empty, malformed (no scheme, spaces, control characters), or otherwise rejected when constructing the downstream RoundTripper after a successful tripper transport setup.","commonSituations":"Misconfigured Kubernetes service DNS name, URL entered with trailing typo, or scheme omitted (e.g. 'query-frontend:9090' instead of 'http://query-frontend:9090').","solutions":["Ensure --query-frontend.downstream-url includes a valid scheme, e.g. http://query-frontend:9090.","Check for whitespace, control characters, or typos in the URL flag.","Read the wrapped underlying error for the exact URL parse failure.","Verify the downstream address resolves/reachable once the URL is valid."],"exampleFix":"// before\n--query-frontend.downstream-url=query-frontend-query.thanos:9090\n// after\n--query-frontend.downstream-url=http://query-frontend-query.thanos:9090","handlingStrategy":"validation","validationCode":"u, err := url.Parse(downstreamURL)\nif err != nil || u.Scheme == \"\" || u.Host == \"\" {\n  return fmt.Errorf(\"invalid downstream url %q\", downstreamURL)\n}","typeGuard":null,"tryCatchPattern":"rt, err := cortexfrontend.NewDownstreamRoundTripper(url, tripper)\nif err != nil {\n  return fmt.Errorf(\"setup downstream roundtripper: %w\", err)\n}","preventionTips":["Always include http:// or https:// in downstream-url","Trim whitespace from flag values in manifests","Smoke-test the URL before deploy"],"tags":["url","config","roundtripper"],"backgroundTag":"invalid-url","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"}