jaegertracing/jaeger · error
indices.%s: cannot use both 'rotation' config and legacy 'da
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'.
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)
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.
Related errors
- cannot use both 'rotation' config and legacy flags (%s) simu
- indices.%s.rotation: exactly one rotation strategy must be s
- 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/b8c330e5d48e766f.
Report an issue: GitHub.