{"record":{"id":"b3e078f73443bb4c","repo":"jdx/mise","slug":"tap-directory-directory-tree-was-truncated","errorCode":null,"errorMessage":"tap {directory} directory tree was truncated","messagePattern":"tap (.+?) directory tree was truncated","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/tap.rs","lineNumber":274,"sourceCode":"            tap_source.api_base, tap_source.commit\n        ))\n        .await\n        .wrap_err(\"failed to inspect tap formula directories\")?;\n    if root_tree.truncated {\n        bail!(\"tap repository tree was truncated\");\n    }\n\n    let (directory, formula_tree) =\n        if let Some((directory, sha)) = active_formula_directory(&root_tree) {\n            let tree: GithubTree = HTTP_FETCH\n                .json_cached(format!(\n                    \"{}/git/trees/{sha}?recursive=1\",\n                    tap_source.api_base\n                ))\n                .await\n                .wrap_err_with(|| format!(\"failed to inspect tap {directory} directory\"))?;\n            if tree.truncated {\n                bail!(\"tap {directory} directory tree was truncated\");\n            }\n            (directory, tree)\n        } else {\n            (\"\", root_tree)\n        };\n\n    let source_path = formula_source_path(directory, &formula_tree, name).ok_or_else(|| {\n        let location = if directory.is_empty() {\n            \"repository root\"\n        } else {\n            directory\n        };\n        eyre::eyre!(\"tap has no formula named '{name}' in {location}\")\n    })?;\n    let source = HTTP_FETCH\n        .get_text(ruby_source_url(&tap_source.raw_base, &source_path))\n        .await\n        .wrap_err_with(|| format!(\"failed to fetch tap formula {source_path}\"))?;","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/tap.rs#L256-L292","documentation":"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.","triggerScenarios":"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.","commonSituations":"Taps with an enormous number of formula files in one directory (e.g. huge homebrew mirrors); recursive listing exceeding GitHub's response limits.","solutions":["Use a tap with fewer entries in its formula directory or pin an older commit","Fetch the specific formula .rb file directly by path instead of listing the directory","Report/split the oversized tap upstream"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(e) = result {\n    if e.to_string().contains(\"directory tree was truncated\") {\n        // fall back to fetching the .rb file by raw URL for the known name\n    }\n}","preventionTips":["Avoid taps whose Formula/ or Casks/ directory holds thousands of entries","Fetch individual formula files by raw URL when the tap is known to be huge"],"tags":["brew","github","api"],"backgroundTag":"http-error-response","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}