{"record":{"id":"8b06fb049c64abc3","repo":"astrid-runtime/astrid","slug":"durable-capsule-id-disappeared-during-manifest-c","errorCode":null,"errorMessage":"durable capsule {id} disappeared during manifest check","messagePattern":"durable capsule (.+?) disappeared during manifest check","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/manifest_check.rs","lineNumber":235,"sourceCode":"    Ok(export_conflicts_from_metadata(manifest, &peers))\n}\n\nfn durable_capsule_metadata(\n    store: &RuntimePrincipalStore,\n    uid: PrincipalUid,\n) -> anyhow::Result<Vec<(String, crate::meta::CapsuleMeta)>> {\n    let owner = StateOwner::Principal(uid);\n    let summaries = store\n        .capsules()\n        .list(&owner)\n        .context(\"list durable capsules for manifest check\")?;\n    summaries\n        .into_iter()\n        .map(|summary| {\n            let id = summary.id().to_owned();\n            let package =\n                read_verified_durable_package_for_owner(store, &owner, &id)?.ok_or_else(|| {\n                    anyhow::anyhow!(\"durable capsule {id} disappeared during manifest check\")\n                })?;\n            Ok((id, package.metadata().clone()))\n        })\n        .collect()\n}\n\nfn missing_imports_from_metadata(\n    manifest: &CapsuleManifest,\n    peers: &[(String, crate::meta::CapsuleMeta)],\n) -> Vec<MissingImport> {\n    manifest\n        .import_tuples()\n        .filter_map(|(ns, name, req, optional)| {\n            if optional {\n                return None;\n            }\n            let satisfied = peers.iter().any(|(id, meta)| {\n                id != &manifest.package.name","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/manifest_check.rs#L217-L253","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-run the manifest check; transient races usually resolve once the concurrent operation completes.","Ensure only one capsule install/remove process runs against the same store at a time (file or lock-based serialization).","List installed capsules and verify the reported ID still exists; remove orphaned entries if any.","If reproducible without concurrency, check storage integrity — the registry may be corrupt and need republishing of the capsule."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt in 0..3 {\n    match validate_imports_in_storage(/* ... */) {\n        Ok(_) => break,\n        Err(e) if e.to_string().contains(\"disappeared during manifest check\") && attempt < 2 => continue,\n        Err(e) => return Err(e),\n    }\n}","preventionTips":["Do not run concurrent install/remove operations against the same capsule store.","Use a lock or single-process owner for registry mutations.","Re-run manifest checks after any concurrent capsule operation completes."],"tags":["race-condition","storage","manifest-check"],"backgroundTag":"resource-not-found","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"}