astrid-runtime/astrid · error

materialized capsule is absent from durable registry

Error message

materialized capsule is absent from durable registry

What it means

The durable capsule registry was consulted for the published capsule under the owner's UID, but no record was returned. Verification expects the materialized capsule to also exist in the durable registry; its absence means the publication record is missing or was removed, so the materialization cannot be verified.

Solutions

  1. Re-publish the capsule so the durable registry record is recreated, then re-run verification
  2. Check that the queried StateOwner::Principal(uid) matches the UID that actually owns the materialization
  3. Restore the registry entry from backup or run the repair_published_materialization flow
  4. Inspect registry pruning/cleanup jobs that may have removed the record
Defensive patterns

Strategy: validation

Validate before calling

let record = registry.read_verified_durable_package_for_owner(owner, name)?;
if record.is_none() {
    return Err(format!("capsule {name} has no durable registry record; re-publish before verifying"));
}

Try / catch

match read_verified_durable_package_for_owner(&store, &owner, name)? {
    Some(verified) => compare_and_accept(verified),
    None => {
        log::warn!("capsule {name} missing from durable registry; triggering repair");
        repair_flow(name)
    }
}

Prevention

When it happens

Trigger: verify_published_materialization() calls read_verified_durable_package_for_owner(...) and the Option comes back None, hitting .ok_or_else(|| anyhow!("materialized capsule is absent from durable registry")).

Common situations: The durable registry entry was deleted (cleanup job, manual prune) while the on-disk materialization remains; the package was materialized under a different owner UID than queried; a failed publication never wrote the registry record.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/f42f45d84de8977c. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-kernel/src/capsule_materialization.rs:29

        &self,
        dir: &Path,
        principal: &astrid_core::principal::PrincipalId,
        manifest: &astrid_capsule_types::manifest::CapsuleManifest,
        snapshot: &astrid_storage::CapsulePackageSnapshot,
    ) -> anyhow::Result<()> {
        self.validate_published_cache_path(dir, principal, manifest, snapshot)?;
        let uid = self
            .principal_directory
            .uid_for(principal)
            .map_err(|error| anyhow::anyhow!("resolve capsule cache owner UID: {error}"))?;
        let verified = astrid_capsule_install::read_verified_durable_package_for_owner(
            self.principal_store
                .as_ref()
                .ok_or_else(|| anyhow::anyhow!("durable capsule registry is unavailable"))?,
            &astrid_storage::StateOwner::Principal(uid),
            manifest.package.name.as_str(),
        )?
        .ok_or_else(|| anyhow::anyhow!("materialized capsule is absent from durable registry"))?;
        if verified.snapshot() != snapshot {
            anyhow::bail!("materialized capsule snapshot differs from the caller's publication");
        }
        if verified.manifest().package.name != manifest.package.name
            || verified.manifest().package.version != manifest.package.version
        {
            anyhow::bail!("materialized capsule manifest differs from durable registry");
        }
        let manifest_bytes = Self::read_projection_file_nofollow(&dir.join("Capsule.toml"))
            .map_err(|error| anyhow::anyhow!("read materialized capsule manifest: {error:#}"))?;
        if manifest_bytes != verified.manifest_bytes() {
            anyhow::bail!("durable capsule manifest bytes do not match materialization");
        }
        let metadata_bytes = Self::read_projection_file_nofollow(&dir.join("meta.json"))
            .map_err(|error| anyhow::anyhow!("read materialized capsule metadata: {error:#}"))?;
        if metadata_bytes != verified.metadata_bytes() {
            anyhow::bail!("durable capsule metadata does not match materialization");
        }

View on GitHub (pinned to affd8760f4)