astrid-runtime/astrid · warning
durable capsule package is malformed
Error message
durable capsule package is malformed
What it means
Thrown during durable-state recovery/materialization when a durable capsule snapshot has no package manifest (`manifest` is `None`) even though a package was expected (lib.rs:2562). The kernel cannot materialize a published capsule from a snapshot lacking a manifest, so it treats the durable package as malformed, logs a warning, and skips materialization rather than crashing the recovery pass.
Solutions
- Delete the malformed durable package/snapshot and reinstall or republish the capsule so a fresh manifest is written
- Inspect the durable storage directory for truncated/partial package files and remove them
- Check kernel version compatibility: re-publish capsules persisted by an older manifest format
Defensive patterns
Strategy: fallback
Validate before calling
// Before recovery, sanity-check durable packages
for pkg in durable_packages {
if pkg.manifest().is_none() {
quarantine(pkg); // skip malformed snapshot before materialization
}
} Try / catch
match materialization_result {
Err(e) if e.to_string().contains("durable capsule package is malformed") => {
tracing::warn!("skipping malformed durable package; republish required");
// mark for republish and continue recovery
},
other => other?,
} Prevention
- Ensure durable package writes are atomic (write-temp-then-rename) to avoid torn files
- Pin kernel versions across a cluster so manifest formats stay compatible
- Periodically validate durable storage and republish capsules with missing manifests
When it happens
Trigger: Recovery/reload loop iterating durable capsule snapshots where the stored package exists but its manifest cannot be produced (lib.rs:2562) — a truncated or partially written durable package, or a snapshot written by an incompatible writer.
Common situations: Crash or power loss mid-write leaving a torn package file in the durable store; upgrading the kernel across a manifest format change so old packages no longer parse into a manifest; disk corruption in the capsule storage directory.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- an incomplete capsule authority update exists at
- cannot load capsule ' ' for unadmitted principal
- cannot remove capsule authority while an install…
- capsule ' ' failed to load
- capsule ' ' has no source directory
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/bbec79ec69a25cf0.
Report an issue: GitHub.
Appendix: source
Thrown at crates/astrid-kernel/src/lib.rs:2562
error = %error,
"Skipping durable capsule with unsafe materialization target"
);
continue;
},
};
let manifest = astrid_capsule_install
::read_verified_durable_package_for_owner(
store, &owner, &id,
)
.ok()
.flatten()
.map(|package| package.manifest().clone());
let materialized = match manifest {
Some(manifest) => self.ensure_published_materialization(
&target, principal, &manifest, &snapshot,
),
None => {
Err(anyhow::anyhow!("durable capsule package is malformed"))
},
};
if let Err(error) = materialized {
tracing::warn!(
%principal,
capsule = %id,
error = %error,
"Skipping durable capsule that failed materialization"
);
continue;
}
paths.push(target);
}
},
Err(error) => {
tracing::warn!(
%principal,
error = %error,View on GitHub (pinned to affd8760f4)