{"record":{"id":"7a719619520829d5","repo":"vectordotdev/vector","slug":"could-not-parse-filename","errorCode":null,"errorMessage":"Could not parse {filename}","messagePattern":"Could not parse (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/deprecation/enact.rs","lineNumber":47,"sourceCode":"            bail!(\n                \"expected a deprecation slug (e.g. \\\"azure-monitor-logs-sink\\\"), not a path: {}\",\n                self.slug\n            );\n        }\n        let stem = self.slug.strip_suffix(\".md\").unwrap_or(&self.slug);\n        let filename = format!(\"{stem}.md\");\n\n        let path = dir.join(&filename);\n        if !path.exists() {\n            bail!(\"No deprecation fragment found at {}\", path.display());\n        }\n\n        // Parse the fragment to get entry data.\n        let entries = deprecation::read_deprecation_fragments(&dir)?;\n        let entry = entries\n            .into_iter()\n            .find(|e| e.filename == filename)\n            .ok_or_else(|| anyhow::anyhow!(\"Could not parse {filename}\"))?;\n\n        let version = if let Some(v) = self.version {\n            // Reject `--version 0.58.0-alpha` and friends: only release-shaped\n            // semver is valid here.\n            if !v.pre.is_empty() || !v.build.is_empty() {\n                bail!(\n                    \"--version {v} has prerelease or build metadata; only plain X.Y.Z is allowed\"\n                );\n            }\n            v\n        } else {\n            let latest = git::latest_release_version()?;\n            Version::new(latest.major, latest.minor + 1, 0)\n        };\n\n        if !deprecation::later_minor(&version, &entry.deprecated_since.0) {\n            bail!(\n                \"removed_in ({version}) must be in a later minor release than deprecated_since ({}); \\","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/deprecation/enact.rs#L29-L65","documentation":"`vdev deprecation enact` reads all changelog deprecation fragments in the directory and then finds the one matching the requested filename. If no parsed fragment's filename matches the CLI argument, it throws \"Could not parse {filename}\" — even though the real problem is the fragment was not found or failed to parse upstream.","triggerScenarios":"Running `vdev deprecation enact <filename>` with a filename that does not exist in the deprecation fragments directory, is misspelled, includes an incorrect extension, or whose fragment file failed to parse inside `read_deprecation_fragments` and was therefore absent from the list.","commonSituations":"Typo in the fragment filename passed on the CLI; the fragment was already enacted and removed; YAML front-matter in the fragment is malformed so parsing skipped/failed; wrong directory scanned.","solutions":["List the fragment files in the deprecation fragments directory (changelog.d) and use an exact, existing filename.","Fix malformed front-matter/content in the fragment file so it parses.","Verify the fragment hasn't already been enacted and deleted."],"exampleFix":"// before\nvdev deprecation enact 2024-01-01-remove_foo.md\n\n// after (exact existing fragment filename)\nvdev deprecation enact 2025-01-15_remove_foo.md","handlingStrategy":"validation","validationCode":"import { existsSync, readdirSync } from 'fs';\nif (!existsSync(`changelog.d/${filename}`)) {\n  throw new Error(`Fragment ${filename} not found in changelog.d; available: ${readdirSync('changelog.d').join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await enactDeprecation(filename);\n} catch (e) {\n  if (/Could not parse/.test(String(e))) {\n    console.error(`Fragment \"${filename}\" not found or unparseable — check the exact filename in changelog.d`);\n  } else throw e;\n}","preventionTips":["Copy the exact fragment filename from the directory listing rather than retyping it.","Keep fragment front-matter well-formed so parsing succeeds.","Check the fragment still exists (has not been enacted/removed) before running the command."],"tags":["cli","changelog","vector"],"backgroundTag":"file-not-found","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"}