{"record":{"id":"658fe9b266245072","repo":"thanos-io/thanos","slug":"downstream-url-should-be-configured","errorCode":null,"errorMessage":"downstream URL should be configured","messagePattern":"downstream URL should be configured","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/queryfrontend/config.go","lineNumber":301,"sourceCode":"\t\t\treturn err\n\t\t}\n\t}\n\n\tif cfg.LabelsConfig.ResultsCacheConfig != nil {\n\t\tif cfg.LabelsConfig.SplitQueriesByInterval <= 0 {\n\t\t\treturn errors.New(\"split queries interval should be greater than 0  when caching is enabled\")\n\t\t}\n\t\tif err := cfg.LabelsConfig.ResultsCacheConfig.Validate(querier.Config{}); err != nil {\n\t\t\treturn errors.Wrap(err, \"invalid ResultsCache config for labels tripperware\")\n\t\t}\n\t}\n\n\tif cfg.DefaultTimeRange == 0 {\n\t\treturn errors.New(\"labels.default-time-range cannot be set to 0\")\n\t}\n\n\tif cfg.DownstreamURL == \"\" {\n\t\treturn errors.New(\"downstream URL should be configured\")\n\t}\n\n\treturn nil\n}\n\nfunc (cfg *Config) validateDynamicSplitParams() error {\n\tif cfg.HorizontalShards <= 0 {\n\t\treturn errors.New(\"min horizontal shards should be greater than 0 when query split threshold is enabled\")\n\t}\n\n\tif cfg.MaxQuerySplitInterval <= 0 {\n\t\treturn errors.New(\"max query split interval should be greater than 0 when query split threshold is enabled\")\n\t}\n\n\tif cfg.MinQuerySplitInterval <= 0 {\n\t\treturn errors.New(\"min query split interval should be greater than 0 when query split threshold is enabled\")\n\t}\n\treturn nil","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/queryfrontend/config.go#L283-L319","documentation":"The query-frontend acts as a proxy and forwards requests to a downstream Prometheus-compatible URL; Validate() requires cfg.DownstreamURL to be non-empty. Without it the frontend has nowhere to send uncached/split queries, so startup is aborted.","triggerScenarios":"Config.Validate is called with cfg.DownstreamURL == \"\" — the downstream_url (or -query-frontend.downstream-url flag) was not set, or was set to an empty string via env expansion.","commonSituations":"Minimal query-frontend deployments where operators enabled split/cache features but forgot the downstream target; environment-variable-based configs where DOWNSTREAM_URL is unset in the deployment environment; typos leaving the key under the wrong YAML block.","solutions":["Set downstream_url in the query_frontend config block to the upstream Prometheus/Thanos query URL","When using env expansion, ensure the environment variable is defined in the pod/container","Verify the flag -query-frontend.downstream-url is passed if configuring via flags","Point it at the correct scheme and address, e.g. http://thanos-query:9090"],"exampleFix":"// before\nquery_frontend:\n  split_queries_by_interval: 15m\n// after\nquery_frontend:\n  downstream_url: http://thanos-query:9090\n  split_queries_by_interval: 15m","handlingStrategy":"validation","validationCode":"if cfg.DownstreamURL == \"\" {\n    return errors.New(\"query_frontend.downstream_url must be set\")\n}\nif _, err := url.Parse(cfg.DownstreamURL); err != nil {\n    return fmt.Errorf(\"downstream_url malformed: %w\", err)\n}","typeGuard":"func downstreamConfigured(cfg Config) bool { return cfg.DownstreamURL != \"\" }","tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"downstream URL\") {\n        log.Fatalf(\"configure -query-frontend.downstream-url: %v\", err)\n    }\n}","preventionTips":["Include downstream_url in the base config template for query-frontend deployments","When using env expansion, add a readiness check that the env var is non-empty","Point downstream at an internal service URL reachable from the frontend pods"],"tags":["config","validation","query-frontend","url"],"backgroundTag":"missing-required-config-field","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"}