vectordotdev/vector · error
Could not parse
Error message
Could not parse {filename} What it means
`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.
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.
Example fix
// before vdev deprecation enact 2024-01-01-remove_foo.md // after (exact existing fragment filename) vdev deprecation enact 2025-01-15_remove_foo.md
Defensive patterns
Strategy: validation
Validate before calling
import { existsSync, readdirSync } from 'fs';
if (!existsSync(`changelog.d/${filename}`)) {
throw new Error(`Fragment ${filename} not found in changelog.d; available: ${readdirSync('changelog.d').join(', ')}`);
} Try / catch
try {
await enactDeprecation(filename);
} catch (e) {
if (/Could not parse/.test(String(e))) {
console.error(`Fragment "${filename}" not found or unparseable — check the exact filename in changelog.d`);
} else throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- already exists
- Changelog fragment has unrecognized type ' ' (valid types: )
- Changelog fragment is invalid (filename must be . .md)
- does not exist
- a record with a next ID must have an event count
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/7a719619520829d5.
Report an issue: GitHub.
Appendix: source
Thrown at vdev/src/commands/deprecation/enact.rs:47
bail!(
"expected a deprecation slug (e.g. \"azure-monitor-logs-sink\"), not a path: {}",
self.slug
);
}
let stem = self.slug.strip_suffix(".md").unwrap_or(&self.slug);
let filename = format!("{stem}.md");
let path = dir.join(&filename);
if !path.exists() {
bail!("No deprecation fragment found at {}", path.display());
}
// Parse the fragment to get entry data.
let entries = deprecation::read_deprecation_fragments(&dir)?;
let entry = entries
.into_iter()
.find(|e| e.filename == filename)
.ok_or_else(|| anyhow::anyhow!("Could not parse {filename}"))?;
let version = if let Some(v) = self.version {
// Reject `--version 0.58.0-alpha` and friends: only release-shaped
// semver is valid here.
if !v.pre.is_empty() || !v.build.is_empty() {
bail!(
"--version {v} has prerelease or build metadata; only plain X.Y.Z is allowed"
);
}
v
} else {
let latest = git::latest_release_version()?;
Version::new(latest.major, latest.minor + 1, 0)
};
if !deprecation::later_minor(&version, &entry.deprecated_since.0) {
bail!(
"removed_in ({version}) must be in a later minor release than deprecated_since ({}); \View on GitHub (pinned to bdb87aeaa4)