{"record":{"id":"9b5e228994733934","repo":"vectordotdev/vector","slug":"conflicting-enacted-entry-for-already-recorded-as-removed-in","errorCode":null,"errorMessage":"Conflicting enacted entry for '{}': already recorded as removed in {}, refusing to record as removed in {}","messagePattern":"Conflicting enacted entry for '(.+?)': already recorded as removed in (.+?), refusing to record as removed in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/utils/deprecation.rs","lineNumber":292,"sourceCode":"/// Append an enacted entry and regenerate the pending section from deprecation.d/.\n///\n/// Idempotent only on a byte-for-byte duplicate: silently skips the append\n/// so that re-running `enact` after a partial failure (e.g. the fragment\n/// delete failed) can complete cleanly. Any mismatch in `removed_in`,\n/// `deprecated_since`, or `description` is rejected — those signal a stale\n/// or edited fragment versus the recorded entry, and silently keeping the\n/// older record would lose the new data.\npub fn append_enacted(repo_root: &Path, entry: EnactedEntry) -> Result<()> {\n    let dir = repo_root.join(DEPRECATION_DIR);\n    let pending = read_deprecation_fragments(&dir)?;\n    let mut data = read_json(repo_root)?;\n    if let Some(existing) = data\n        .deprecations_enacted\n        .iter()\n        .find(|e| e.what == entry.what)\n    {\n        if existing.removed_in != entry.removed_in {\n            bail!(\n                \"Conflicting enacted entry for '{}': already recorded as removed in {}, refusing to record as removed in {}\",\n                entry.what,\n                existing.removed_in,\n                entry.removed_in\n            );\n        }\n        if existing.deprecated_since != entry.deprecated_since\n            || existing.description != entry.description\n        {\n            bail!(\n                \"Mismatched enacted entry for '{}': the existing record in {} differs from the fragment data \\\n                 (deprecated_since or description). \\\n                 Either revert the fragment edit or update the enacted JSON by hand.\",\n                entry.what,\n                existing.removed_in,\n            );\n        }\n        // Byte-for-byte duplicate; rewrite pending so a partial failure can","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/utils/deprecation.rs#L274-L310","documentation":"`append_enacted` records a deprecation as removed in the enacted JSON. If an entry with the same `what` already exists but records a different `removed_in` version, the data is contradictory, and it bails rather than silently overwriting history. The message shows both versions.","triggerScenarios":"Calling `append_enacted` for a fragment whose `what` matches an existing enacted entry but whose `removed_in` differs — typically after editing the fragment's removed_in after it was already enacted.","commonSituations":"Editing a fragment's removal version after the deprecation was enacted; merging branches that enacted the same deprecation with different versions; a typo in the fragment's version number.","solutions":["Decide which removed_in version is correct and update the fragment to match the enacted JSON","Or correct the enacted JSON by hand to the right version if the recorded one was wrong","Revert the fragment edit (`git checkout changelog.d/<file>`) if it was unintentional","Re-run the sync once the versions agree"],"exampleFix":"// before (fragment edited)\nremoved_in: 0.49.0   # enacted JSON says 0.48.0\n// after\nremoved_in: 0.48.0   # match existing enacted entry, or update JSON deliberately","handlingStrategy":"validation","validationCode":"// before appending, confirm the fragment matches the enacted record\nlet existing = json.deprecations_enacted.iter().find(|e| e.what == fragment.what);\nif let Some(e) = existing {\n    assert_eq!(e.removed_in, fragment.removed_in, \"removed_in conflict for {}\", fragment.what);\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"Conflicting enacted entry\") => {\n        // reconcile fragment vs JSON, then retry\n    }\n    other => other?,\n}","preventionTips":["Do not edit a fragment after it has been enacted; version corrections belong in the JSON","Keep fragment and enacted JSON changes in the same PR to avoid divergence","When in conflict, prefer the enacted JSON's recorded history unless deliberately rewriting it"],"tags":["rust","deprecation","versioning","conflict"],"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"}