jdx/mise · error

pkgx bottle for {} did not contain {}

Error message

pkgx bottle for {} did not contain {}

What it means

Thrown by `install_package` in the pkgx backend: after downloading and extracting a pkgx bottle into a temp dir and copying/renaming it to the expected install prefix, mise verifies the prefix directory exists. If the extracted bottle didn't contain the expected prefix path, the install is aborted because the layout doesn't match what pkgx bottles are supposed to contain.

Source

Thrown at src/backend/pkgx.rs:620

        format,
        &ExtractOptions {
            strip_components: 0,
            pr: Some(ctx.pr.as_ref()),
            preserve_mtime: false,
        },
    )?;
    if tmp
        .path()
        .join(&package.name)
        .join(format!("v{}", package.version))
        .exists()
    {
        file::copy_dir_all(tmp.path(), pkgx_root)?;
    } else {
        file::rename(tmp.path(), &prefix)?;
    }
    if !prefix.exists() {
        bail!(
            "pkgx bottle for {} did not contain {}",
            package.name,
            prefix.display()
        );
    }
    file::write(package_receipt_path(&prefix), package_receipt(bottle))?;
    Ok(())
}

fn package_is_installed(prefix: &Path, bottle: &PkgxPackageInfo) -> Result<bool> {
    if !prefix.exists() {
        return Ok(false);
    }
    if fs::read_to_string(package_receipt_path(prefix)).ok() == Some(package_receipt(bottle)) {
        return Ok(true);
    }
    file::remove_all(prefix)?;
    Ok(false)

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Clear the pkgx/bottle cache and reinstall (`mise cache clear`, then `mise install pkgx:<name>@<version>`) to force a fresh, complete download.
  2. Try a different version of the package, which may have a correctly-built bottle for your platform.
  3. Check network path (corporate proxy/mirror) for content rewriting, and retry on a direct connection.
  4. If the bottle is consistently broken, report the malformed bottle to the pkgx package maintainers or fall back to another backend for this tool.
Defensive patterns

Strategy: retry

Validate before calling

# clear caches and retry on truncated downloads
mise cache clear && mise install pkgx:mytool@1.2.3

Try / catch

try { await $`mise install` } catch (e) { if (String(e).includes('did not contain')) { await $`mise cache clear`; await $`mise install`; } else throw e; }

Prevention

When it happens

Trigger: Installing a pkgx package (`install_version_` / `install_from_locked` -> `install_package`) where the downloaded bottle's extracted contents lack the expected prefix directory (e.g. `prefix.display()` path not present after extraction) — a truncated download, an unexpected bottle layout, or an empty archive.

Common situations: Network interruption produced a partial bottle cached on disk; upstream pkgx changed the bottle directory layout for the package/version; a proxy or mirror served an HTML error page saved as the bottle; platform-specific bottle missing for the current OS/arch.

Understand the failure class

Background: "empty response", "returned no data", "empty embeddings": what HTTP 200-with-empty-body errors mean across libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/1962ebacf73bb166. Report an issue: GitHub.