{"record":{"id":"cba392a4d97effb9","repo":"jdx/mise","slug":"registry-archive-is-too-large","errorCode":null,"errorMessage":"registry archive is too large","messagePattern":"registry archive is too large","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/registry.rs","lineNumber":383,"sourceCode":"}\n\nfn track_registry_archive_entry(\n    index: usize,\n    entry_size: u64,\n    archive_size: &mut u64,\n) -> Result<()> {\n    ensure!(\n        index < MAX_REGISTRY_ARCHIVE_ENTRIES,\n        \"registry archive contains too many entries\"\n    );\n    ensure!(\n        entry_size <= MAX_REGISTRY_ARCHIVE_ENTRY_SIZE,\n        \"registry archive entry is too large\"\n    );\n    *archive_size = archive_size\n        .checked_add(entry_size)\n        .ok_or_else(|| eyre::eyre!(\"registry archive size overflow\"))?;\n    ensure!(\n        *archive_size <= MAX_REGISTRY_ARCHIVE_SIZE,\n        \"registry archive is too large\"\n    );\n    Ok(())\n}\n\nfn registry_from_sources(sources: BTreeMap<String, String>) -> Result<Registry> {\n    let mut entries = BTreeMap::new();\n    let mut missing_version_order = false;\n    for (short, source) in sources {\n        let value: toml::Value = toml::from_str(&source)\n            .wrap_err_with(|| format!(\"failed to parse registry/{short}.toml\"))?;\n        let (tool, tool_missing_version_order) = parse_registry_tool(&short, &value)\n            .wrap_err_with(|| format!(\"invalid registry/{short}.toml\"))?;\n        missing_version_order |= tool_missing_version_order;\n        entries.insert(short, tool.clone());\n        for alias in tool.aliases {\n            entries.insert((*alias).to_string(), tool.clone());","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/registry.rs#L365-L401","documentation":"This error is thrown when the cumulative size of all entries in a registry archive exceeds MAX_REGISTRY_ARCHIVE_SIZE. The accumulator adds each entry size with checked_add (overflow is a separate error), then ensures the running total stays within the global cap. It protects the registry loader from unbounded memory/IO use.","triggerScenarios":"Loading a registry archive whose summed entry sizes exceed MAX_REGISTRY_ARCHIVE_SIZE, even if every individual entry is under the per-entry limit.","commonSituations":"A registry that has grown by accreting many entries over time until it crosses the total size cap; bundling large binaries into many entries; downloading a stale or wrong archive from a mirror.","solutions":["Prune obsolete entries from the registry archive to bring total size under MAX_REGISTRY_ARCHIVE_SIZE","Verify you downloaded the correct, current archive (a mirror may serve a bloated or wrong file)","Split the registry into multiple smaller archives if the data genuinely needs to grow","Check for accidental duplication of large blobs across entries"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const MAX_REGISTRY_ARCHIVE_SIZE: u64 = /* limit from src/registry.rs */;\nfn validate_total_archive_size(entries: &[u64]) -> Result<(), String> {\n    let total: u64 = entries.iter().sum();\n    if total > MAX_REGISTRY_ARCHIVE_SIZE {\n        return Err(format!(\"archive total {total} exceeds limit {MAX_REGISTRY_ARCHIVE_SIZE}\"));\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Monitor registry archive size growth in CI and prune stale entries","Add a size budget check before publishing an archive","Avoid duplicating large blobs across entries"],"tags":["registry","validation","size-limit"],"backgroundTag":"file-size-limit-exceeded","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"}