Hmbown/CodeWhale · error

Fleet artifact exceeds the 16 MiB verification limit

Error message

Fleet artifact exceeds the 16 MiB verification limit

What it means

read_verified refuses to verify a Fleet artifact whose on-disk size exceeds the shared 16 MiB MAX_ARTIFACT_BYTES ceiling. The writer and reader share this limit so no artifact can be published that the evidence reader cannot fully stream and hash. This fails closed before reading if the file already exceeds it.

Solutions

  1. Remove or relocate the oversized file from the Fleet workspace — it is not a valid artifact under the current limit.
  2. Republish the content in a truncated/compressed form via artifacts::write so it fits the ceiling.
  3. Check how the file got there (old binary version, external script) and stop that writer from exceeding 16 MiB.
Defensive patterns

Strategy: validation

Validate before calling

let size = fs::metadata(ws.join(&artifact.path))?.len();
if size > 16 * 1024 * 1024 {
    return Err("artifact exceeds 16 MiB verification limit; remove or republish smaller");
}

Prevention

When it happens

Trigger: Calling read_verified for a FleetArtifactRef whose file metadata reports len() > 16 MiB — e.g. the artifact was written by an older build without the ceiling, or placed into the workspace by an external process.

Common situations: Mixing artifacts produced by a pre-limit version of the tool with a current reader; an external tool or manual copy dropped a large file at the artifact path; a symlink pointing at a big file elsewhere in the workspace.

Understand the failure class

Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/b2a50d9629fee224. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/fleet/artifacts.rs:54

            ensure!(
                saved == bytes,
                "An existing Fleet artifact contains different bytes"
            );
            Ok(())
        }
        Err(error) => Err(error).context("Publishing Fleet artifact"),
    }
}

pub(crate) fn read_verified(
    workspace: &Path,
    artifact: &FleetArtifactRef,
    preview_limit: u64,
) -> Result<(Vec<u8>, u64)> {
    let parent = WorkspaceFile::open(workspace, &artifact.path, false)?;
    let file = parent.open_file()?;
    let size = file.metadata()?.len();
    ensure!(
        size <= MAX_ARTIFACT_BYTES,
        "Fleet artifact exceeds the 16 MiB verification limit"
    );
    ensure!(
        artifact.size_bytes.is_none_or(|expected| expected == size),
        "Fleet artifact size changed"
    );
    let checksum = artifact
        .checksum
        .as_deref()
        .context("Fleet artifact has no recorded checksum")?;
    let mut hasher = Sha256::new();
    let mut preview = Vec::new();
    let mut buffer = [0_u8; 8192];
    let mut total = 0_u64;
    // The digest and returned preview consume exactly the same bytes from the
    // same opened file. A changed/replaced pathname is never reopened for data.
    let mut reader = (&file).take(size + 1);

View on GitHub (pinned to 73e0f67d83)