{"record":{"id":"ff5f09fe5b82fd19","repo":"astrid-runtime/astrid","slug":"resolve-durable-capsule-cache-target-error","errorCode":null,"errorMessage":"resolve durable capsule cache target: {error}","messagePattern":"resolve durable capsule cache target: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-kernel/src/lib.rs","lineNumber":1569,"sourceCode":"        snapshot: &astrid_storage::CapsulePackageSnapshot,\n    ) -> anyhow::Result<PathBuf> {\n        let uid = self\n            .principal_directory\n            .uid_for(principal)\n            .map_err(|error| anyhow::anyhow!(\"resolve capsule cache owner UID: {error}\"))?;\n        let digest = blake3::hash(&snapshot.package().archive)\n            .to_hex()\n            .to_string();\n        astrid_capsule_install::resolve_cache_target_dir(\n            &self.astrid_home,\n            uid,\n            manifest.package.name.as_str(),\n            &digest,\n            false,\n            None,\n            &self.workspace_layout,\n        )\n        .map_err(|error| anyhow::anyhow!(\"resolve durable capsule cache target: {error}\"))\n    }\n\n    /// Validate the disposable cache path against an exact owner snapshot.\n    #[cfg(not(all(target_arch = \"wasm32\", target_os = \"unknown\")))]\n    fn validate_published_cache_path(\n        &self,\n        dir: &Path,\n        principal: &PrincipalId,\n        manifest: &astrid_capsule_types::manifest::CapsuleManifest,\n        snapshot: &astrid_storage::CapsulePackageSnapshot,\n    ) -> anyhow::Result<()> {\n        let cache_root = self.astrid_home.run_dir().join(\"capsules\");\n        let relative = dir.strip_prefix(&cache_root).map_err(|_| {\n            anyhow::anyhow!(\"capsule cache path is outside the durable registry cache\")\n        })?;\n        astrid_core::platform_fs::verify_no_redirects(dir)\n            .map_err(|error| anyhow::anyhow!(\"capsule cache path is redirected: {error}\"))?;\n        let components: Vec<String> = relative","sourceCodeStart":1551,"sourceCodeEnd":1587,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-kernel/src/lib.rs#L1551-L1587","documentation":"Wraps a failure of `astrid_capsule_install::resolve_cache_target_dir`: the kernel could not compute the durable cache directory for (astrid_home, uid, capsule id, archive digest) given the workspace layout. The error is propagated after all inputs were already gathered.","triggerScenarios":"Calling published_cache_target when resolve_cache_target_dir rejects its inputs — e.g. layout conflict between astrid_home and workspace_layout, or an invalid uid/name/digest combination.","commonSituations":"Workspace layout configured incompatibly with astrid_home (custom override colliding with the durable layout); digest computed from a mismatched snapshot; capsule name containing characters invalid as a path component; version drift between astrid-capsule-install and the kernel.","solutions":["Read the inner error ({error}) to see which input resolve_cache_target_dir rejected","Remove conflicting workspace_layout overrides so the default durable layout is used","Verify the capsule name is a safe path component (see invalid durable capsule id error)","Re-sync crate versions so astrid-capsule-install matches the kernel expectations"],"exampleFix":"// before\nresolve_cache_target_dir(&home, uid, name, &digest, false, None, &custom_layout)?\n// after\nresolve_cache_target_dir(&home, uid, name, &digest, false, None, &WorkspaceLayout::default())?","handlingStrategy":"fallback","validationCode":"assert!(capsule_name_chars_ok(manifest.package.name.as_str()));\nassert!(!snapshot.package().archive.is_empty());","typeGuard":null,"tryCatchPattern":"let target = match resolve_cache_target_dir(&home, uid, name, &digest, false, None, &layout) {\n    Ok(t) => t,\n    Err(e) => return Err(anyhow!(\"resolve durable capsule cache target: {e}; check workspace_layout overrides\")),\n};","preventionTips":["Avoid custom workspace_layout overrides unless required","Keep astrid-capsule-install and astrid-kernel versions in lockstep","Always derive digests from the same snapshot you pass to the resolver"],"tags":["cache","path-resolution","layout","capsule"],"backgroundTag":"cache-target-resolution-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"}