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

  1. Read the inner error ({error}) to see which input resolve_cache_target_dir rejected
  2. Remove conflicting workspace_layout overrides so the default durable layout is used
  3. Verify the capsule name is a safe path component (see invalid durable capsule id error)
  4. 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

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


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> = relative

View on GitHub (pinned to affd8760f4)