{"record":{"id":"3b5245123f7c9e39","repo":"astrid-runtime/astrid","slug":"installed-capsule-version-disagrees-between-c","errorCode":null,"errorMessage":"installed capsule '{}' version disagrees between Capsule.toml ({}) and meta.json ({})","messagePattern":"installed capsule '(.+?)' version disagrees between Capsule\\.toml \\((.+?)\\) and meta\\.json \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/init_grant.rs","lineNumber":267,"sourceCode":"            );\n        }\n        let meta = super::super::capsule::meta::read_meta(&target_dir).ok_or_else(|| {\n            anyhow::anyhow!(\n                \"Distro.lock capsule '{}' has no readable install metadata for target '{}'\",\n                capsule.name,\n                target\n            )\n        })?;\n        if manifest.package.version != meta.version {\n            bail!(\n                \"installed capsule '{}' version disagrees between Capsule.toml ({}) and meta.json ({})\",\n                expected,\n                manifest.package.version,\n                meta.version\n            );\n        }\n        if !capsule.version.is_empty() && meta.version != capsule.version {\n            bail!(\n                \"Distro.lock capsule '{}' expects version {}, but meta.json reports {}\",\n                capsule.name,\n                capsule.version,\n                meta.version\n            );\n        }\n        validate_locked_wasm(\n            home,\n            &expected,\n            &manifest,\n            meta.wasm_hash.as_deref(),\n            &capsule.hash,\n            store,\n        )?;\n        installed.push(expected.as_str().to_string());\n    }\n    Ok(installed)\n}","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/init_grant.rs#L249-L285","documentation":"After reading both the capsule manifest (Capsule.toml) and install metadata (meta.json), the validator requires them to agree on the installed version. A disagreement means the install is inconsistent and bails with this message naming both versions.","triggerScenarios":"manifest.package.version != meta.version for a locked capsule — Capsule.toml says one version while meta.json records another.","commonSituations":"An upgrade replaced Capsule.toml but failed to update meta.json (interrupted install); a manual file copy swapped in a new capsule over old metadata; parallel installs racing on the same target directory.","solutions":["Reinstall the capsule (rerun init) so Capsule.toml and meta.json are written consistently.","Delete the capsule's install directory and perform a clean install.","Check for interrupted upgrades in logs and avoid concurrent installs to the same target.","If intentional downgrade/upgrade was manual, redo it with the CLI rather than editing files."],"exampleFix":"// meta.json says 1.0.0 but Capsule.toml says 1.1.0 after a botched upgrade\n// before\n$ ls target/  # mixed files from two versions\n// after\n$ rm -rf <capsule-target-dir> && astrid init --distro my-distro","handlingStrategy":"validation","validationCode":"// cross-check before granting\nlet manifest = read_manifest(dir)?;\nlet meta = read_meta(dir)?;\nif manifest.package.version != meta.version {\n    eprintln!(\"inconsistent install: Capsule.toml {} vs meta.json {}\",\n        manifest.package.version, meta.version);\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"version disagrees\") => eprintln!(\"reinstall capsule for consistent metadata\"),\n    Err(e) => return Err(e),\n    Ok(v) => Ok(v),\n}","preventionTips":["Avoid concurrent installs/upgrades to the same capsule target.","Retry interrupted upgrades from scratch rather than partially.","Use the CLI for upgrades so both files are updated atomically.","Verify version agreement after any manual intervention."],"tags":["version-mismatch","metadata","consistency"],"backgroundTag":"invalid-state-transition","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}