jdx/mise · error

registry archive is too large

Error message

registry archive is too large

What it means

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.

Solutions

  1. Prune obsolete entries from the registry archive to bring total size under MAX_REGISTRY_ARCHIVE_SIZE
  2. Verify you downloaded the correct, current archive (a mirror may serve a bloated or wrong file)
  3. Split the registry into multiple smaller archives if the data genuinely needs to grow
  4. Check for accidental duplication of large blobs across entries
Defensive patterns

Strategy: validation

Validate before calling

const MAX_REGISTRY_ARCHIVE_SIZE: u64 = /* limit from src/registry.rs */;
fn validate_total_archive_size(entries: &[u64]) -> Result<(), String> {
    let total: u64 = entries.iter().sum();
    if total > MAX_REGISTRY_ARCHIVE_SIZE {
        return Err(format!("archive total {total} exceeds limit {MAX_REGISTRY_ARCHIVE_SIZE}"));
    }
    Ok(())
}

Prevention

When it happens

Trigger: Loading a registry archive whose summed entry sizes exceed MAX_REGISTRY_ARCHIVE_SIZE, even if every individual entry is under the per-entry limit.

Common situations: 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.

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 jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/cba392a4d97effb9. Report an issue: GitHub.

Appendix: source

Thrown at src/registry.rs:383

}

fn track_registry_archive_entry(
    index: usize,
    entry_size: u64,
    archive_size: &mut u64,
) -> Result<()> {
    ensure!(
        index < MAX_REGISTRY_ARCHIVE_ENTRIES,
        "registry archive contains too many entries"
    );
    ensure!(
        entry_size <= MAX_REGISTRY_ARCHIVE_ENTRY_SIZE,
        "registry archive entry is too large"
    );
    *archive_size = archive_size
        .checked_add(entry_size)
        .ok_or_else(|| eyre::eyre!("registry archive size overflow"))?;
    ensure!(
        *archive_size <= MAX_REGISTRY_ARCHIVE_SIZE,
        "registry archive is too large"
    );
    Ok(())
}

fn registry_from_sources(sources: BTreeMap<String, String>) -> Result<Registry> {
    let mut entries = BTreeMap::new();
    let mut missing_version_order = false;
    for (short, source) in sources {
        let value: toml::Value = toml::from_str(&source)
            .wrap_err_with(|| format!("failed to parse registry/{short}.toml"))?;
        let (tool, tool_missing_version_order) = parse_registry_tool(&short, &value)
            .wrap_err_with(|| format!("invalid registry/{short}.toml"))?;
        missing_version_order |= tool_missing_version_order;
        entries.insert(short, tool.clone());
        for alias in tool.aliases {
            entries.insert((*alias).to_string(), tool.clone());

View on GitHub (pinned to 533346cc37)