{"record":{"id":"1c7199968753ed25","repo":"vectordotdev/vector","slug":"duplicate-enacted-entry-for-the-same-feature-cannot-be","errorCode":null,"errorMessage":"Duplicate enacted entry for '{}'; the same feature cannot be recorded as removed more than once.","messagePattern":"Duplicate enacted entry for '(.+?)'; the same feature cannot be recorded as removed more than once\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/utils/deprecation.rs","lineNumber":388,"sourceCode":"                e.what, e.deprecated_since\n            )\n        })?;\n        let rem = parse_strict_release(&e.removed_in).with_context(|| {\n            format!(\n                \"Enacted entry '{}' has invalid removed_in '{}'\",\n                e.what, e.removed_in\n            )\n        })?;\n        if !later_minor(&rem, &dep) {\n            bail!(\n                \"Enacted entry '{}' has removed_in ({}) that is not in a later minor release than deprecated_since ({}); the deprecation policy requires at least one minor release between announcement and removal.\",\n                e.what,\n                e.removed_in,\n                e.deprecated_since\n            );\n        }\n        if !seen.insert(e.what.clone()) {\n            bail!(\n                \"Duplicate enacted entry for '{}'; the same feature cannot be recorded as removed more than once.\",\n                e.what\n            );\n        }\n    }\n    Ok(enacted.len())\n}\n\n/// True when `a` is in a later major.minor release than `b`. Equal or smaller\n/// major.minor (regardless of patch) returns false.\npub fn later_minor(a: &Version, b: &Version) -> bool {\n    (a.major, a.minor) > (b.major, b.minor)\n}\n\n/// Parse a release version string strictly: only plain `X.Y.Z` is allowed\n/// (no prerelease or build metadata). Mirrors the rule that release tags\n/// follow `vX.Y.Z`.\npub fn parse_strict_release(s: &str) -> Result<Version> {","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/utils/deprecation.rs#L370-L406","documentation":"vdev's deprecation tooling enforces that each deprecated feature appears at most once in the enacted-removals list. During validate_enacted, each entry is inserted into a `seen` HashSet; if `insert` returns false the same `what` value was already recorded, and validation bails. This prevents double bookkeeping of a feature removal (e.g. two entries with differing removed_in dates) from silently corrupting the generated deprecation data.","triggerScenarios":"Calling validate_enacted when the enacted list contains two entries whose `what` field is the identical string — e.g. the same feature listed twice with different removed_in or deprecated_since values, or a merge/patch that duplicated a line.","commonSituations":"Hand-editing or code-generating the deprecation metadata and accidentally duplicating an entry; rebasing/merging two branches that each added an entry for the same feature; copy-pasting an entry to update its date instead of editing the existing one.","solutions":["Remove or merge the duplicate entry so each feature's `what` appears exactly once in the enacted list","If two entries have different dates, keep the correct one and delete the stale copy","Run validate_enacted again to confirm the list is unique"],"exampleFix":"// before\n[[enacted]]\nwhat = \"old_transform\"\nremoved_in = \"0.40.0\"\n[[enacted]]\nwhat = \"old_transform\"\nremoved_in = \"0.41.0\"\n// after\n[[enacted]]\nwhat = \"old_transform\"\nremoved_in = \"0.41.0\"","handlingStrategy":"validation","validationCode":"let names: Vec<&str> = enacted.iter().map(|e| e.what.as_str()).collect();\nlet dupes: Vec<&str> = names.iter().filter(|n| names.iter().filter(|m| m == n).count() > 1).map(|n| *n).collect();\nif !dupes.is_empty() { return Err(format!(\"duplicate enacted entries: {:?}\", dupes)); }","typeGuard":null,"tryCatchPattern":"match validate_enacted(&enacted) {\n    Err(e) if e.to_string().contains(\"Duplicate enacted entry\") => {\n        eprintln!(\"Fix duplicate deprecation entry: {e}\");\n    }\n    Err(e) => return Err(e),\n    Ok(n) => println!(\"{n} enacted entries validated\"),\n}","preventionTips":["Keep one canonical entry per feature; edit dates in place rather than adding new entries","Check for duplicated entries after every merge/rebase of deprecation metadata","Add a CI check that fails on duplicate `what` values before validation runs"],"tags":["rust","validation","deprecation","duplicate-entry"],"backgroundTag":"conflicting-config-options","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}