{"record":{"id":"b270e3f88f05bb3a","repo":"vectordotdev/vector","slug":"deprecation-fragment-has-unclosed-frontmatter","errorCode":null,"errorMessage":"Deprecation fragment {} has unclosed frontmatter","messagePattern":"Deprecation fragment (.+?) has unclosed frontmatter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/utils/deprecation.rs","lineNumber":212,"sourceCode":"\n/// Split the raw file contents into the frontmatter string and the body.\n/// The file must begin with `---`, and have a closing `---` on its own line.\nfn split_frontmatter<'a>(content: &'a str, path: &Path) -> Result<(&'a str, &'a str)> {\n    let content = content.trim_start();\n    // Advance past the opening `---` (and optional trailing whitespace on that line)\n    let after_open = content\n        .strip_prefix(\"---\")\n        .ok_or_else(|| {\n            anyhow!(\n                \"Deprecation fragment {} must begin with YAML frontmatter (---)\",\n                path.display()\n            )\n        })?\n        .trim_start_matches([' ', '\\t'])\n        .trim_start_matches('\\n');\n\n    let (frontmatter, rest) = after_open.split_once(\"\\n---\").ok_or_else(|| {\n        anyhow!(\n            \"Deprecation fragment {} has unclosed frontmatter\",\n            path.display()\n        )\n    })?;\n    let rest = rest.trim_start_matches(['\\r', '\\n']);\n    let body = rest.trim_start_matches(['\\r', '\\n']);\n\n    Ok((frontmatter, body))\n}\n\n/// A deprecation that has been enacted (feature removed).\n#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]\npub struct EnactedEntry {\n    pub what: String,\n    pub deprecated_since: String,\n    pub removed_in: String,\n    #[serde(default, skip_serializing_if = \"String::is_empty\")]\n    pub description: String,","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/utils/deprecation.rs#L194-L230","documentation":"After finding the opening `---`, `split_frontmatter` locates the closing delimiter via `split_once(\"\\n---\")`. If no closing `\\n---` sequence exists, the frontmatter block is unterminated and this error is raised with the fragment path. It protects the parser from consuming Markdown body content as YAML metadata.","triggerScenarios":"A deprecation fragment contains an opening `---` line but no second `---` line on its own line (e.g. author wrote frontmatter fields and forgot the closing delimiter, or the closing `---` is on the same line as content).","commonSituations":"Hand-writing frontmatter and omitting the closing fence; a formatter wrapping/joining the closing `---` with adjacent text; using `----` or indented dashes that still don't form a `\\n---` boundary at line start context expected by split_once.","solutions":["Add a closing `---` on its own line after the frontmatter keys in the file named in the error.","Ensure the closing delimiter is preceded by a newline (frontmatter content must not share its line).","Diff the fragment against a known-good deprecation fragment to confirm both opening and closing fences are present."],"exampleFix":"# before\n---\ndate: 2026-09-15\ncomponent: transform/foo\n\n# after\n---\ndate: 2026-09-15\ncomponent: transform/foo\n---\ndeprecates the `foo` transform.","handlingStrategy":"validation","validationCode":"def has_closed_frontmatter(text):\n    t = text.lstrip('\\ufeff \\t\\n\\r')\n    if not t.startswith('---'):\n        return False\n    return '\\n---' in t[3:]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always close frontmatter with `---` on its own line before the Markdown body.","Disable formatters/wrappers that could join the closing delimiter with body text.","Run the deprecation-fragment check locally (e.g. `make check-*` target) before pushing."],"tags":["yaml","frontmatter","deprecation","rust"],"backgroundTag":"yaml-parse-error","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"}