jdx/mise · error

tap directory tree was truncated

Error message

tap {directory} directory tree was truncated

What it means

After selecting the tap's Formula/Casks directory, fetch_formula_source requests its sub-tree with ?recursive=1. If that recursive tree response is flagged truncated, the formula file listing would be incomplete, so it bails with this error naming the directory.

Solutions

  1. Use a tap with fewer entries in its formula directory or pin an older commit
  2. Fetch the specific formula .rb file directly by path instead of listing the directory
  3. Report/split the oversized tap upstream
Defensive patterns

Strategy: retry

Try / catch

if let Err(e) = result {
    if e.to_string().contains("directory tree was truncated") {
        // fall back to fetching the .rb file by raw URL for the known name
    }
}

Prevention

When it happens

Trigger: The recursive tree request for the tap's `Formula` or `Casks` directory (identified by active_formula_directory) comes back with truncated=true from the GitHub API.

Common situations: Taps with an enormous number of formula files in one directory (e.g. huge homebrew mirrors); recursive listing exceeding GitHub's response limits.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/b3e078f73443bb4c. Report an issue: GitHub.

Appendix: source

Thrown at src/system/packages/brew/tap.rs:274

            tap_source.api_base, tap_source.commit
        ))
        .await
        .wrap_err("failed to inspect tap formula directories")?;
    if root_tree.truncated {
        bail!("tap repository tree was truncated");
    }

    let (directory, formula_tree) =
        if let Some((directory, sha)) = active_formula_directory(&root_tree) {
            let tree: GithubTree = HTTP_FETCH
                .json_cached(format!(
                    "{}/git/trees/{sha}?recursive=1",
                    tap_source.api_base
                ))
                .await
                .wrap_err_with(|| format!("failed to inspect tap {directory} directory"))?;
            if tree.truncated {
                bail!("tap {directory} directory tree was truncated");
            }
            (directory, tree)
        } else {
            ("", root_tree)
        };

    let source_path = formula_source_path(directory, &formula_tree, name).ok_or_else(|| {
        let location = if directory.is_empty() {
            "repository root"
        } else {
            directory
        };
        eyre::eyre!("tap has no formula named '{name}' in {location}")
    })?;
    let source = HTTP_FETCH
        .get_text(ruby_source_url(&tap_source.raw_base, &source_path))
        .await
        .wrap_err_with(|| format!("failed to fetch tap formula {source_path}"))?;

View on GitHub (pinned to 533346cc37)