{"record":{"id":"4e1d08748620fa04","repo":"astrid-runtime/astrid","slug":"daemon-rejected-capsule-install-message","errorCode":null,"errorMessage":"daemon rejected capsule install: {message}","messagePattern":"daemon rejected capsule install: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/install_daemon.rs","lineNumber":245,"sourceCode":"                apply_values(&mut admin, target, capsule_id.as_str(), &values).await?;\n            }\n            let version = output\n                .get(\"installed_version\")\n                .and_then(serde_json::Value::as_str)\n                .unwrap_or(manifest.package.version.as_str())\n                .to_owned();\n            let wasm_hash = output\n                .get(\"wasm_hash\")\n                .and_then(serde_json::Value::as_str)\n                .map(str::to_owned);\n            Ok(InstalledCapsuleOutcome {\n                id: capsule_id,\n                version,\n                wasm_hash,\n                skipped: false,\n            })\n        },\n        KernelResponse::Error(message) => bail!(\"daemon rejected capsule install: {message}\"),\n        other => bail!(\"unexpected daemon response: {other:?}\"),\n    }\n}\n\nfn resume_generation_from_receipt(\n    receipt: Option<CapsuleInstallResumeReceipt>,\n    expected_id: &CapsuleId,\n    source_digest: &str,\n    expected_generation_hint: Option<&InstalledCapsuleGeneration>,\n) -> Option<InstalledCapsuleGeneration> {\n    let receipt = receipt?;\n    if receipt.id != expected_id.as_str()\n        || !is_digest(source_digest)\n        || receipt.archive_digest != source_digest\n        || !is_generation_well_formed(&receipt.generation)\n        || expected_generation_hint.is_some_and(|hint| hint != &receipt.generation)\n    {\n        return None;","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/install_daemon.rs#L227-L263","documentation":"install_local_via_daemon_for_target_with_generation matches on KernelResponse from the daemon during a capsule install. The explicit KernelResponse::Error(message) arm bails with the daemon's own rejection message. The install was rejected server-side, so the message text comes from the kernel, not the CLI.","triggerScenarios":"Sending a capsule install kernel request where the daemon kernel answers KernelResponse::Error — e.g. invalid capsule id/version, wasm hash mismatch, quota or policy rejection.","commonSituations":"Installing a capsule whose wasm_hash doesn't match a previously registered one; version conflicts on reinstall; daemon policy forbidding the principal to install that capsule.","solutions":["Read the {message} text in the error — it is the daemon kernel's reason for rejection.","Verify the capsule id, version, and wasm hash are consistent with any prior install/receipt.","Use the resume/generation flags (see resume_generation_from_receipt) to retry from the last receipt instead of reinstalling.","Check daemon logs for the kernel-side rejection details."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify id/version/hash consistency with prior receipt before install\nassert!(receipt.capsule_id == capsule_id && receipt.version == version)","typeGuard":"if let KernelResponse::Error(msg) = resp { return Err(msg); }","tryCatchPattern":"catch the error, surface the daemon's {message} verbatim to the operator, and only retry with resume flags if the reason is transient.","preventionTips":["Never change wasm contents without bumping the capsule version.","Reuse the install receipt/generation for retries instead of fresh installs.","Confirm the principal has install permission for the target capsule."],"tags":["daemon","install","rpc","capsule"],"backgroundTag":"api-error-response","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}