jaegertracing/jaeger · error
indices. : cannot use both 'rotation' config and legacy…
Error message
indices.%s: cannot use both 'rotation' config and legacy 'date_layout'/'rollover_frequency' fields; use 'rotation.periodic' instead
What it means
Per-index, the new 'rotation' section and the legacy per-index date_layout/rollover_frequency fields are mutually exclusive. validateRotationConfig iterates each index entry and raises this error if an index has both an active rotation strategy and legacy field overrides, directing users to 'rotation.periodic'.
Solutions
- Remove date_layout and rollover_frequency from the indices.<type> section
- Express the desired cadence via rotation.periodic instead
- Keep one mechanism per index, not both
Example fix
// before
indices:
spans:
date_layout: 2006.01.02
rollover_frequency: day
rotation:
periodic:
days: 1
// after
indices:
spans:
rotation:
periodic:
days: 1 Defensive patterns
Strategy: validation
Validate before calling
for _, idx := range []struct{name string; r Rotation; opts IndexOptions}{
{"spans", cfg.Indices.Spans.Rotation, cfg.Indices.Spans.Options},
} {
if idx.r.HasRotation() && (idx.opts.DateLayout.HasValue() || idx.opts.RolloverFrequency.HasValue()) {
return fmt.Errorf("indices.%s: drop date_layout/rollover_frequency, use rotation.periodic", idx.name)
}
} Prevention
- One rotation mechanism per index
- When adding rotation.periodic, delete legacy date fields in the same edit
- Test config with a startup dry-run
When it happens
Trigger: For any of spans/services/dependencies/sampling indices: e.rotation.HasRotation() is true while e.opts.DateLayout.HasValue() or e.opts.RolloverFrequency.HasValue() during Validate.
Common situations: Migrating index templates: new rotation block added but old date_layout/rollover_frequency keys left in the same index section of the YAML.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- cannot use both 'rotation' config and legacy flags
- indices. .rotation: data_stream is not yet implemented
- indices. .rotation: exactly one rotation strategy must be…
- ' ' is no longer supported: ; please remove the setting…
- unrecognized log_level
AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01).
Data as JSON: /api/errors/b8c330e5d48e766f.
Report an issue: GitHub.
Appendix: source
Thrown at internal/storage/elasticsearch/config/config_rotation.go:132
}
type rotationEntry struct {
name string
opts *IndexOptions
rotation *RotationConfig
}
entries := []rotationEntry{
{"spans", &c.Indices.Spans, &c.Indices.Spans.Rotation},
{"services", &c.Indices.Services, &c.Indices.Services.Rotation},
{"dependencies", &c.Indices.Dependencies, &c.Indices.Dependencies.Rotation},
{"sampling", &c.Indices.Sampling, &c.Indices.Sampling.Rotation},
}
for _, e := range entries {
if err := e.rotation.validate(e.name); err != nil {
return err
}
if e.rotation.HasRotation() && (e.opts.DateLayout.HasValue() || e.opts.RolloverFrequency.HasValue()) {
return fmt.Errorf(
"indices.%s: cannot use both 'rotation' config and legacy "+
"'date_layout'/'rollover_frequency' fields; use 'rotation.periodic' instead",
e.name,
)
}
}
return nil
}
func (r *RotationConfig) validate(indexType string) error {
count := 0
if r.Periodic.HasValue() {
count++
}
if r.ManualRollover.HasValue() {
count++
}View on GitHub (pinned to 806f444784)