jaegertracing/jaeger · error
indices.%s.rotation: exactly one rotation strategy must be s
Error message
indices.%s.rotation: exactly one rotation strategy must be set, found %d
What it means
Each index's rotation section must specify exactly one rotation strategy (e.g. periodic) — zero or multiple set strategies are rejected. validate counts the strategies that have values and errors when count > 1 with the actual number found.
Source
Thrown at internal/storage/elasticsearch/config/config_rotation.go:158
return nil
}
func (r *RotationConfig) validate(indexType string) error {
count := 0
if r.Periodic.HasValue() {
count++
}
if r.ManualRollover.HasValue() {
count++
}
if r.AutoRollover.HasValue() {
count++
}
if r.DataStream.HasValue() {
count++
}
if count > 1 {
return fmt.Errorf(
"indices.%s.rotation: exactly one rotation strategy must be set, found %d",
indexType, count,
)
}
if r.DataStream.HasValue() {
return fmt.Errorf(
"indices.%s.rotation: data_stream is not yet implemented",
indexType,
)
}
return nil
}
View on GitHub (pinned to 806f444784)
Solutions
- Keep exactly one strategy field set under indices.<type>.rotation
- Delete the extra strategy entries
- Use rotation.periodic for time-based rollover (data_stream is not supported yet)
Example fix
// before
rotation:
periodic:
days: 1
data_stream: {}
// after
rotation:
periodic:
days: 1 Defensive patterns
Strategy: validation
Validate before calling
count := 0
if r.Periodic.HasValue() { count++ }
if r.DataStream.HasValue() { count++ }
if count != 1 {
return fmt.Errorf("rotation must set exactly one strategy, found %d", count)
} Prevention
- Set only one strategy field per index rotation block
- Never template out all strategy fields; template only the chosen one
- Review generated YAML before applying
When it happens
Trigger: Setting more than one rotation strategy (e.g. both a periodic-style option and data_stream, or two strategy fields) under indices.<type>.rotation and calling validate via Validate or rotation tests.
Common situations: Copy-pasting example YAMLs that each used a different strategy into one rotation block; a migration script that writes all strategy fields unconditionally.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- cannot use both 'rotation' config and legacy flags (%s) simu
- indices.%s: cannot use both 'rotation' config and legacy 'da
- indices.%s.rotation: data_stream is not yet implemented
- unrecognized write_mode %q: valid values are %q and %q
- unrecognized log_level %q: valid values are debug, info, err
AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01).
Data as JSON: /api/errors/1253a89b046ad6c2.
Report an issue: GitHub.