vectordotdev/vector · error
invalid fragment contents for
Error message
invalid fragment contents for '{filename}': last line must be 'authors: <name> [<name> ...]' (no trailing blank lines). What it means
The fragment's last line must be an `authors: <name> [<name> ...]` line, read verbatim via `lines().last()` to match generate_cue.rs. Trailing blank lines or a missing authors line break the release tooling's attribution parsing.
Solutions
- Ensure the very last line of the file is `authors: your_github_handle`.
- Remove any blank lines after the authors line.
- Re-run the scaffolder if the fragment structure is badly mangled.
Example fix
// before Some change. // after Some change. authors: jdoe
Defensive patterns
Strategy: validation
Validate before calling
let content = std::fs::read_to_string(path)?;
let last = content.lines().last().unwrap_or("");
assert!(last.starts_with("authors: ") && !last.trim_end().is_empty(), "last line must be 'authors: <names>'"); Prevention
- Keep `authors: handle` as the literal final line of every fragment.
- Disable 'trim trailing newlines' editor settings that can mangle the ending, or verify the ending before committing.
- Never append content below the authors line.
When it happens
Trigger: Running `vdev check changelog-fragments` when the fragment body is the last line (no `authors:` line at all), the authors line is followed by blank lines, or `authors:` lacks the required `authors: ` prefix.
Common situations: Editor auto-trimming or adding a final newline plus blank line; hand-editing the scaffold and deleting the authors line; pasting content after the authors line.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- invalid breaking fragment
- invalid fragment contents for
- invalid fragment contents for
- invalid fragment contents for
- invalid fragment contents for
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/9642da240604b967.
Report an issue: GitHub.
Appendix: source
Thrown at vdev/src/commands/check/changelog_fragments.rs:201
};
if parts[2] != "md" {
bail!("invalid fragment filename '{filename}': extension must be markdown (.md).");
}
Ok(known)
}
fn validate_contents(
path: &std::path::Path,
filename: &str,
fragment_type: &FragmentType,
) -> Result<()> {
let content = std::fs::read_to_string(path)?;
// Match generate_cue.rs, which reads `lines().last()` verbatim: the authors
// line must be the last line, no trailing blank lines allowed.
let last_line = content.lines().last().unwrap_or("");
let Some(names) = last_line.strip_prefix("authors: ") else {
bail!(
"invalid fragment contents for '{filename}': last line must be 'authors: <name> [<name> ...]' (no trailing blank lines)."
);
};
let names = names.trim();
if names.is_empty() {
bail!("invalid fragment contents for '{filename}': authors line has no names.");
}
if names.contains('@') {
bail!(
"invalid fragment contents for '{filename}': author names should not be prefixed with '@'."
);
}
if names.contains(',') {
bail!(
"invalid fragment contents for '{filename}': authors should be space delimited, not comma delimited."
);
}
if names.split_whitespace().any(|n| n == TODO_HANDLE) {View on GitHub (pinned to bdb87aeaa4)