astrid-runtime/astrid · error

installed capsule '{}' version disagreement: manifest={}, me

Error message

installed capsule '{}' version disagreement: manifest={}, meta={}, installer={}

What it means

finish_install re-reads the manifest and the installed meta.json after unpacking, and cross-checks three version sources: the manifest, the written meta.json, and the version the installer reported. If any of the three disagree, the capsule's installed state is inconsistent and the CLI bails instead of leaving a corrupt install in place. This is an internal consistency guard for the install pipeline.

Source

Thrown at crates/astrid-cli/src/commands/capsule/install_finish.rs:75

/// Validate install output, surface diagnostics, and persist manual install
/// configuration before returning the installed capsule identity.
pub(super) fn finish_install(
    output: &InstallOutput,
    home: &AstridHome,
    principal: &astrid_core::PrincipalId,
    prompt: &ManualInstallOptions,
) -> anyhow::Result<InstalledCapsuleOutcome> {
    let batch = BATCH_MODE.load(std::sync::atomic::Ordering::Relaxed);
    let manifest_path = output.target_dir.join("Capsule.toml");
    let manifest = astrid_capsule::discovery::load_manifest(&manifest_path)
        .context("re-reading manifest for post-install diagnostics")?;

    let capsule_id = CapsuleId::new(manifest.package.name.clone())?;
    let meta = super::meta::read_meta(&output.target_dir)
        .context("installed capsule has no readable meta.json")?;
    if manifest.package.version != meta.version || output.installed_version != meta.version {
        bail!(
            "installed capsule '{}' version disagreement: manifest={}, meta={}, installer={}",
            capsule_id,
            manifest.package.version,
            meta.version,
            output.installed_version
        );
    }
    if output.wasm_hash != meta.wasm_hash {
        bail!(
            "installed capsule '{}' hash disagreement: installer={:?}, meta={:?}",
            capsule_id,
            output.wasm_hash,
            meta.wasm_hash
        );
    }

    let cli_commands: Vec<&astrid_capsule::manifest::CommandDef> = manifest
        .commands

View on GitHub (pinned to affd8760f4)

Solutions

  1. Re-run the install cleanly: delete the capsule target dir (including meta.json) and install again so all artifacts come from the same source.
  2. Verify the manifest version matches the capsule you actually intended to install; bump or fix capsule.toml if it was edited post-build.
  3. Check which release/tag/archive was resolved — a pinned tag may resolve to a differently-versioned build than the manifest.
  4. If reproducible, report a bug: the installer returned output.installed_version inconsistent with what was written to meta.json.

Example fix

// before (installing a rebuilt capsule over a stale install)
astrid capsule install ./my-capsule   # manifest says 1.2.0, old meta.json says 1.1.0
// after
clean the target dir first (or re-pack so manifest and built wasm/meta agree), then:
astrid capsule install ./my-capsule
Defensive patterns

Strategy: validation

Validate before calling

// before installing, ensure manifest version matches any existing meta.json
let manifest_version = &manifest.package.version;
if let Ok(meta) = read_meta(&target_dir) {
    if &meta.version != manifest_version {
        std::fs::remove_dir_all(&target_dir)?; // clear stale install
    }
}

Prevention

When it happens

Trigger: finish_install (called from install_from_local_path_for_principal or unpack_via_lib) detects manifest.package.version != meta.version or output.installed_version != meta.version when finishing a capsule install.

Common situations: A stale build artifact or cached tarball whose manifest version differs from the unpacked one; a partially written or tampered meta.json in the target dir; an installer/unpack path that installed a different version than the manifest declares (e.g. tag pointing at an older capsule).

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/d2e82fe5ccb733b5. Report an issue: GitHub.