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

  1. Remove date_layout and rollover_frequency from the indices.<type> section
  2. Express the desired cadence via rotation.periodic instead
  3. 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

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


AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01). Data as JSON: /api/errors/b8c330e5d48e766f. Report an issue: GitHub.