{"record":{"id":"5fe28446461031e9","repo":"astrid-runtime/astrid","slug":"distro-lock-capsule-has-no-readable-install-m","errorCode":null,"errorMessage":"Distro.lock capsule '{}' has no readable install metadata for target '{}'","messagePattern":"Distro\\.lock capsule '(.+?)' has no readable install metadata for target '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/init_grant.rs","lineNumber":259,"sourceCode":"                \"Distro.lock is fresh but capsule '{}' is not installed correctly for '{}'; rerun init after removing the stale lock\",\n                capsule.name, target\n            )\n        })?;\n        let actual = CapsuleId::new(manifest.package.name.clone())?;\n        if actual != expected {\n            bail!(\n                \"Distro.lock capsule '{expected}' resolves to installed manifest '{actual}'; refusing to grant stale identity\"\n            );\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,","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/init_grant.rs#L241-L277","documentation":"While validating Distro.lock entries, the CLI reads the capsule's install metadata (meta.json) at the install target. If meta.json is missing or unreadable, it cannot confirm what was installed and bails with this message.","triggerScenarios":"validate_locked_capsules_with_store calls read_meta on the capsule's target directory and receives None — meta.json absent, corrupted, or unreadable.","commonSituations":"A partial/failed install left the capsule directory without metadata; the user manually deleted or cleaned meta.json; filesystem permissions prevent reading the file; install was done by an older CLI version writing a different layout.","solutions":["Rerun init/install to reinstall the capsule and regenerate meta.json.","Remove the stale install directory for that capsule and reinstall cleanly.","Check file permissions on the install directory and meta.json.","If an older tool wrote the metadata, reinstall with the current CLI version."],"exampleFix":"// before\nrm -rf ~/.astrid/capsules/my-capsule   # partial install, no meta.json\n// after\nastrid init --distro my-distro          # reinstall regenerates meta.json","handlingStrategy":"validation","validationCode":"// pre-check before grant reuse\nlet meta_path = target_dir.join(\"meta.json\");\nif !meta_path.exists() {\n    eprintln!(\"missing meta.json for {}; reinstall required\", target_dir.display());\n}","typeGuard":"fn has_meta(dir: &Path) -> bool { dir.join(\"meta.json\").is_file() }","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"no readable install metadata\") => eprintln!(\"reinstall capsule to regenerate meta.json\"),\n    Err(e) => return Err(e),\n    Ok(v) => Ok(v),\n}","preventionTips":["Avoid deleting meta.json or cleaning install dirs partially.","Let the CLI perform installs/upgrades instead of copying files manually.","Check directory permissions before installs.","Verify install completion (meta.json present) after upgrades."],"tags":["metadata","file-read","capsule-install"],"backgroundTag":"file-read-failed","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"}