astrid-runtime/astrid · error

durable capsule disappeared during manifest check

Error message

durable capsule {id} disappeared during manifest check

What it means

While building the id->metadata map during a manifest check, durable_capsule_metadata re-reads each capsule package that a summary listing just reported. If read_verified_durable_package_for_owner returns Ok(None) for an ID the listing produced, the capsule vanished between listing and reading, and this error is raised rather than silently skipping it.

Solutions

  1. Re-run the manifest check; transient races usually resolve once the concurrent operation completes.
  2. Ensure only one capsule install/remove process runs against the same store at a time (file or lock-based serialization).
  3. List installed capsules and verify the reported ID still exists; remove orphaned entries if any.
  4. If reproducible without concurrency, check storage integrity — the registry may be corrupt and need republishing of the capsule.
Defensive patterns

Strategy: retry

Try / catch

for attempt in 0..3 {
    match validate_imports_in_storage(/* ... */) {
        Ok(_) => break,
        Err(e) if e.to_string().contains("disappeared during manifest check") && attempt < 2 => continue,
        Err(e) => return Err(e),
    }
}

Prevention

When it happens

Trigger: validate_imports_in_storage or check_export_conflicts_in_storage runs while another process concurrently removes or re-installs the same durable capsule in the registry store, so the summary snapshot lists a capsule whose package is gone at read time.

Common situations: Two capsule CLI invocations racing (one removing a dependency while another validates imports); a partially failed uninstall leaving stale listing entries; external tampering with the registry storage directory.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at crates/astrid-capsule-install/src/manifest_check.rs:235

    Ok(export_conflicts_from_metadata(manifest, &peers))
}

fn durable_capsule_metadata(
    store: &RuntimePrincipalStore,
    uid: PrincipalUid,
) -> anyhow::Result<Vec<(String, crate::meta::CapsuleMeta)>> {
    let owner = StateOwner::Principal(uid);
    let summaries = store
        .capsules()
        .list(&owner)
        .context("list durable capsules for manifest check")?;
    summaries
        .into_iter()
        .map(|summary| {
            let id = summary.id().to_owned();
            let package =
                read_verified_durable_package_for_owner(store, &owner, &id)?.ok_or_else(|| {
                    anyhow::anyhow!("durable capsule {id} disappeared during manifest check")
                })?;
            Ok((id, package.metadata().clone()))
        })
        .collect()
}

fn missing_imports_from_metadata(
    manifest: &CapsuleManifest,
    peers: &[(String, crate::meta::CapsuleMeta)],
) -> Vec<MissingImport> {
    manifest
        .import_tuples()
        .filter_map(|(ns, name, req, optional)| {
            if optional {
                return None;
            }
            let satisfied = peers.iter().any(|(id, meta)| {
                id != &manifest.package.name

View on GitHub (pinned to affd8760f4)