vectordotdev/vector · error

invalid fragment contents for

Error message

invalid fragment contents for '{filename}': author names should not be prefixed with '@'.

What it means

Raised by validate_contents while parsing the 'authors:' line, which must be the last line of the fragment. If any author name carries an '@' handle prefix (e.g. '@alice'), the checker rejects it: authors must be plain names, since the release-generation tooling copies them verbatim and '@' characters break downstream formatting.

Solutions

  1. Strip the `@` prefix from each handle on the authors line.
  2. Use plain handles separated by spaces: `authors: jdoe asmith`.
  3. Search the fragment for '@' before committing.

Example fix

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

Strategy: validation

Validate before calling

let names = last.strip_prefix("authors: ").unwrap_or("").trim();
assert!(!names.contains('@'), "strip '@' from author handles");

Prevention

When it happens

Trigger: Running `vdev check changelog-fragments` when the last line is like `authors: @jdoe` — any space-delimited token on the authors line contains '@'.

Common situations: Copy-pasting a GitHub mention from an issue or PR into the authors line; habitual social-handle formatting.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

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

    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.
    // All templates start their placeholder lines with a literal `TODO ` at column 0,
    // which is rare in real fragment text.
    if let Some(bad) = content.lines().find(|l| l.starts_with("TODO ")) {

View on GitHub (pinned to bdb87aeaa4)