thanos-io/thanos · error
split queries interval and dynamic query split interval…
Error message
split queries interval and dynamic query split interval cannot be set at the same time
What it means
Validate rejects mutually exclusive split settings: a static --query-range.split-queries-by-interval and the newer dynamic query-split threshold cannot both be set, because the engine cannot decide which split strategy to apply. Returning this error prevents ambiguous caching/splitting behavior.
Solutions
- Remove either --query-range.split-queries-by-interval (static) or --query-range.dynamic-split-threshold (dynamic).
- Prefer dynamic splitting on newer Thanos; drop the static flag from systemd units, manifests, or Helm values.
- Audit all flag sources (CLI, env, Helm) so only one split mechanism is set.
Example fix
// before
flags := []string{"--query-range.split-queries-by-interval=24h", "--query-range.dynamic-split-threshold=10"}
// after
flags := []string{"--query-range.dynamic-split-threshold=10"} Defensive patterns
Strategy: validation
Validate before calling
staticSet := splitInterval > 0
dynamicSet := dynamicSplitThreshold > 0
if staticSet && dynamicSet {
return errors.New("only one of --query-range.split-queries-by-interval and --query-range.dynamic-split-threshold may be set")
} Try / catch
if err := cfg.Validate(); err != nil {
if strings.Contains(err.Error(), "cannot be set at the same time") {
return fmt.Errorf("drop one split flag: %w", err)
}
return err
} Prevention
- Grep deployment manifests for both split flags when upgrading.
- Migrate fully to dynamic split and delete the static flag.
- Centralize flag definitions to avoid duplicates across tools.
When it happens
Trigger: cfg.isDynamicSplitSet() and cfg.isStaticSplitSet() are both true — both SplitQueriesByInterval (>0) and the dynamic split threshold are configured.
Common situations: Upgrading Thanos from static to dynamic splitting but leaving the old static flag in place; merged configs from multiple deployment tools each adding a split flag.
Related errors
- split queries or split threshold interval should be greater…
- invalid ResultsCache config for query_range tripperware
- split queries interval should be greater than 0 when…
- invalid ResultsCache config for labels tripperware
- labels.default-time-range cannot be set to 0
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/b0972823d98e8efc.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/queryfrontend/config.go:277
// Validate a fully initialized config.
func (cfg *Config) Validate() error {
if cfg.QueryRangeConfig.ResultsCacheConfig != nil {
if cfg.QueryRangeConfig.SplitQueriesByInterval <= 0 && !cfg.isDynamicSplitSet() {
return errors.New("split queries or split threshold interval should be greater than 0 when caching is enabled")
}
// This is instantiated just to make the QFE config comply with validation against the Cortex Querier,
// but in Thanos we don't use this configuration at all.
ignoredQueryConfig := querier.Config{
EnablePerStepStats: cfg.QueryRangeConfig.ResultsCacheConfig.CacheQueryableSamplesStats,
}
if err := cfg.QueryRangeConfig.ResultsCacheConfig.Validate(ignoredQueryConfig); err != nil {
return errors.Wrap(err, "invalid ResultsCache config for query_range tripperware")
}
}
if cfg.isDynamicSplitSet() && cfg.isStaticSplitSet() {
return errors.New("split queries interval and dynamic query split interval cannot be set at the same time")
}
if cfg.isDynamicSplitSet() {
if err := cfg.validateDynamicSplitParams(); err != nil {
return err
}
}
if cfg.LabelsConfig.ResultsCacheConfig != nil {
if cfg.LabelsConfig.SplitQueriesByInterval <= 0 {
return errors.New("split queries interval should be greater than 0 when caching is enabled")
}
if err := cfg.LabelsConfig.ResultsCacheConfig.Validate(querier.Config{}); err != nil {
return errors.Wrap(err, "invalid ResultsCache config for labels tripperware")
}
}
View on GitHub (pinned to 35b8b99117)