{"record":{"id":"b0a8ca4992af991c","repo":"jaegertracing/jaeger","slug":"cannot-use-both-rotation-config-and-legacy-flags","errorCode":null,"errorMessage":"cannot use both 'rotation' config and legacy flags (%s) simultaneously; remove the legacy flags and use the 'rotation' section instead","messagePattern":"cannot use both 'rotation' config and legacy flags \\((.+?)\\) simultaneously; remove the legacy flags and use the 'rotation' section instead","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/elasticsearch/config/config_rotation.go","lineNumber":109,"sourceCode":"\t// Useful for cross-cluster search or to decouple consumer queries from the\n\t// underlying data stream name. If empty, reads go directly to the data stream.\n\tReadAlias string `mapstructure:\"read_alias\"`\n}\n\n// HasRotation returns true if any rotation variant is explicitly configured.\nfunc (r *RotationConfig) HasRotation() bool {\n\treturn r.Periodic.HasValue() || r.ManualRollover.HasValue() ||\n\t\tr.AutoRollover.HasValue() || r.DataStream.HasValue()\n}\n\nfunc (c *Configuration) validateRotationConfig() error {\n\thasAnyRotation := c.Indices.Spans.Rotation.HasRotation() ||\n\t\tc.Indices.Services.Rotation.HasRotation() ||\n\t\tc.Indices.Dependencies.Rotation.HasRotation() ||\n\t\tc.Indices.Sampling.Rotation.HasRotation()\n\n\tif hasAnyRotation && c.hasAnyLegacyRotationFlags() {\n\t\treturn fmt.Errorf(\n\t\t\t\"cannot use both 'rotation' config and legacy flags (%s) simultaneously; \"+\n\t\t\t\t\"remove the legacy flags and use the 'rotation' section instead\",\n\t\t\tlegacyRotationFlagsList,\n\t\t)\n\t}\n\n\ttype rotationEntry struct {\n\t\tname     string\n\t\topts     *IndexOptions\n\t\trotation *RotationConfig\n\t}\n\tentries := []rotationEntry{\n\t\t{\"spans\", &c.Indices.Spans, &c.Indices.Spans.Rotation},\n\t\t{\"services\", &c.Indices.Services, &c.Indices.Services.Rotation},\n\t\t{\"dependencies\", &c.Indices.Dependencies, &c.Indices.Dependencies.Rotation},\n\t\t{\"sampling\", &c.Indices.Sampling, &c.Indices.Sampling.Rotation},\n\t}\n\tfor _, e := range entries {","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/elasticsearch/config/config_rotation.go#L91-L127","documentation":"Index rotation can now be configured via the structured 'rotation' section under indices.*. Jaeger rejects mixing that section with the legacy rotation CLI flags in a single config, because the two mechanisms would conflict. validateRotationConfig raises this error when both are present.","triggerScenarios":"Config has at least one indices.<type>.rotation entry with HasRotation() true AND any legacy rotation flag (hasAnyLegacyRotationFlags) set, then Validate is called.","commonSituations":"Partially migrating a config: adding the new rotation section while old --es.index-rotation flags remain in the deployment manifest or command line.","solutions":["Delete the legacy rotation flags from args/env","Keep only the 'rotation' section under indices.*","If you intend legacy behavior, remove the rotation section instead"],"exampleFix":"// before\nindices:\n  spans:\n    rotation:\n      periodic:\n        days: 1\nargs: [--es.index-rotation.day-hour=...]  # legacy flag\n// after\nindices:\n  spans:\n    rotation:\n      periodic:\n        days: 1","handlingStrategy":"validation","validationCode":"hasRotationSection := cfg.Indices.Spans.Rotation.HasRotation() || cfg.Indices.Services.Rotation.HasRotation()\nif hasRotationSection && len(legacyRotationFlagsFromArgs(os.Args)) > 0 {\n    return errors.New(\"remove legacy rotation flags; use indices.*.rotation only\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Migrate to the rotation section fully in one change","Grep deployment manifests for legacy rotation flags","Validate config before rollout"],"tags":["elasticsearch","config-validation","index-rotation"],"backgroundTag":"conflicting-config-options","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}