{"record":{"id":"1253a89b046ad6c2","repo":"jaegertracing/jaeger","slug":"indices-s-rotation-exactly-one-rotation-strategy","errorCode":null,"errorMessage":"indices.%s.rotation: exactly one rotation strategy must be set, found %d","messagePattern":"indices\\.(.+?)\\.rotation: exactly one rotation strategy must be set, found (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/elasticsearch/config/config_rotation.go","lineNumber":158,"sourceCode":"\treturn nil\n}\n\nfunc (r *RotationConfig) validate(indexType string) error {\n\tcount := 0\n\tif r.Periodic.HasValue() {\n\t\tcount++\n\t}\n\tif r.ManualRollover.HasValue() {\n\t\tcount++\n\t}\n\tif r.AutoRollover.HasValue() {\n\t\tcount++\n\t}\n\tif r.DataStream.HasValue() {\n\t\tcount++\n\t}\n\tif count > 1 {\n\t\treturn fmt.Errorf(\n\t\t\t\"indices.%s.rotation: exactly one rotation strategy must be set, found %d\",\n\t\t\tindexType, count,\n\t\t)\n\t}\n\tif r.DataStream.HasValue() {\n\t\treturn fmt.Errorf(\n\t\t\t\"indices.%s.rotation: data_stream is not yet implemented\",\n\t\t\tindexType,\n\t\t)\n\t}\n\treturn nil\n}\n","sourceCodeStart":140,"sourceCodeEnd":171,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/elasticsearch/config/config_rotation.go#L140-L171","documentation":"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.","triggerScenarios":"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.","commonSituations":"Copy-pasting example YAMLs that each used a different strategy into one rotation block; a migration script that writes all strategy fields unconditionally.","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)"],"exampleFix":"// before\nrotation:\n  periodic:\n    days: 1\n  data_stream: {}\n// after\nrotation:\n  periodic:\n    days: 1","handlingStrategy":"validation","validationCode":"count := 0\nif r.Periodic.HasValue() { count++ }\nif r.DataStream.HasValue() { count++ }\nif count != 1 {\n    return fmt.Errorf(\"rotation must set exactly one strategy, found %d\", count)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["elasticsearch","config-validation","index-rotation"],"backgroundTag":"invalid-config-value","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}