astrid-runtime/astrid · error
resolve durable capsule cache target
Error message
resolve durable capsule cache target: {error} What it means
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.
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
Example fix
// before resolve_cache_target_dir(&home, uid, name, &digest, false, None, &custom_layout)? // after resolve_cache_target_dir(&home, uid, name, &digest, false, None, &WorkspaceLayout::default())?
Defensive patterns
Strategy: fallback
Validate before calling
assert!(capsule_name_chars_ok(manifest.package.name.as_str())); assert!(!snapshot.package().archive.is_empty());
Try / catch
let target = match resolve_cache_target_dir(&home, uid, name, &digest, false, None, &layout) {
Ok(t) => t,
Err(e) => return Err(anyhow!("resolve durable capsule cache target: {e}; check workspace_layout overrides")),
}; Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- capsule cache owner or id does not match authenticated…
- capsule cache path does not contain owner/id/digest…
- local capsule source
- materialized capsule digest does not match durable registry
- an incomplete capsule authority update exists at
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/ff5f09fe5b82fd19.
Report an issue: GitHub.
Appendix: source
Thrown at crates/astrid-kernel/src/lib.rs:1569
snapshot: &astrid_storage::CapsulePackageSnapshot,
) -> anyhow::Result<PathBuf> {
let uid = self
.principal_directory
.uid_for(principal)
.map_err(|error| anyhow::anyhow!("resolve capsule cache owner UID: {error}"))?;
let digest = blake3::hash(&snapshot.package().archive)
.to_hex()
.to_string();
astrid_capsule_install::resolve_cache_target_dir(
&self.astrid_home,
uid,
manifest.package.name.as_str(),
&digest,
false,
None,
&self.workspace_layout,
)
.map_err(|error| anyhow::anyhow!("resolve durable capsule cache target: {error}"))
}
/// Validate the disposable cache path against an exact owner snapshot.
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
fn validate_published_cache_path(
&self,
dir: &Path,
principal: &PrincipalId,
manifest: &astrid_capsule_types::manifest::CapsuleManifest,
snapshot: &astrid_storage::CapsulePackageSnapshot,
) -> anyhow::Result<()> {
let cache_root = self.astrid_home.run_dir().join("capsules");
let relative = dir.strip_prefix(&cache_root).map_err(|_| {
anyhow::anyhow!("capsule cache path is outside the durable registry cache")
})?;
astrid_core::platform_fs::verify_no_redirects(dir)
.map_err(|error| anyhow::anyhow!("capsule cache path is redirected: {error}"))?;
let components: Vec<String> = relativeView on GitHub (pinned to affd8760f4)