vectordotdev/vector · error

invalid fragment contents for

Error message

invalid fragment contents for '{filename}': authors line has no names.

What it means

The fragment's authors line parsed successfully but contained no actual names after trimming (e.g. `authors:` followed by nothing, or only whitespace). Release attribution requires at least one author.

Solutions

  1. Add at least one GitHub handle after `authors:`, e.g. `authors: jdoe`.
  2. If multiple authors, separate them with spaces: `authors: jdoe asmith`.
  3. Replace any leftover placeholder with a real handle (also see the TODO_HANDLE check).

Example fix

// before
authors: 
// after
authors: jdoe
Defensive patterns

Strategy: validation

Validate before calling

let last = std::fs::read_to_string(path)?.lines().last().unwrap_or("");
let names = last.strip_prefix("authors: ").unwrap_or("").trim();
assert!(!names.is_empty(), "authors line has no names");

Prevention

When it happens

Trigger: Running `vdev check changelog-fragments` when the last line is exactly `authors: ` or `authors:` — the prefix stripped and the remainder trimmed to empty.

Common situations: Deleting the placeholder handle from the scaffold without replacing it; scaffolder TODO placeholder removed but no handle typed in; trailing whitespace after `authors:`.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/4bba521002abd9e0. Report an issue: GitHub.

Appendix: source

Thrown at vdev/src/commands/check/changelog_fragments.rs:207

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) {
        bail!(
            "invalid fragment contents for '{filename}': the scaffolder placeholder '{TODO_HANDLE}' must be replaced with a real GitHub handle."
        );
    }

    // Reject any scaffolded body placeholder that the author forgot to fill in.

View on GitHub (pinned to bdb87aeaa4)