astrid-runtime/astrid · error
candidate generation for '{id}' did not activate within {}ms
Error message
candidate generation for '{id}' did not activate within {}ms What it means
This error fires when a candidate capsule generation fails to complete its async `activate()` future within the 30-second activation timeout enforced by the kernel. It means the capsule process accepted activation but never returned from the activation phase in time. The kernel bails out so the candidate can be discarded or retried under backoff.
Source
Thrown at crates/astrid-kernel/src/lib.rs:4710
strong_count = Arc::strong_count(previous),
"Old capsule generation remains referenced after replacement; autonomous \
work was cancelled and memory reclaims when the last reference drops"
);
RestartOutcome::OldInstanceLingering
}
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
async fn activate_and_wait_ready(
id: &astrid_capsule_types::CapsuleId,
candidate: &mut dyn astrid_capsule::capsule::Capsule,
) -> Result<(), anyhow::Error> {
use astrid_capsule::capsule::ReadyStatus;
let activation_timeout = std::time::Duration::from_secs(30);
let readiness_timeout = std::time::Duration::from_millis(500);
match astrid_runtime::time::timeout(activation_timeout, candidate.activate()).await {
Ok(result) => result?,
Err(_) => anyhow::bail!(
"candidate generation for '{id}' did not activate within {}ms",
activation_timeout.as_millis()
),
}
match candidate.wait_ready(readiness_timeout).await {
ReadyStatus::Ready => Ok(()),
ReadyStatus::Timeout => anyhow::bail!(
"candidate generation for '{id}' did not signal ready within {}ms",
readiness_timeout.as_millis()
),
ReadyStatus::Crashed => {
anyhow::bail!("candidate generation for '{id}' exited before signaling ready")
},
}
}
/// Attempts to restart a failed capsule, respecting backoff and max retries.
///View on GitHub (pinned to affd8760f4)
Solutions
- Inspect the candidate capsule's activate() implementation for blocking or hanging awaits (network, locks, unbounded waits).
- Check host resource pressure (CPU/memory) and any external services the capsule contacts during activation.
- If legitimately slow activation is expected, raise the 30s `activation_timeout` in the kernel's activation path.
- Rely on the kernel's restart/backoff logic to retry the candidate after fixing the root cause.
Example fix
// before let activation_timeout = std::time::Duration::from_secs(30); // after let activation_timeout = std::time::Duration::from_secs(120); // capsule needs longer startup
Defensive patterns
Strategy: try-catch
Validate before calling
// Rust: nothing cheap to pre-check; ensure the capsule's deps are reachable // e.g. health-check external services and confirm binary/config exist before activation
Try / catch
match astrid_runtime::time::timeout(Duration::from_secs(30), candidate.activate()).await {
Ok(result) => result?,
Err(_) => { log::warn!("activation timed out; will retry with backoff"); /* retry or discard candidate */ }
} Prevention
- Keep capsule activate() non-blocking and free of long external awaits
- Add startup instrumentation/logging to capsules to find slow activation phases
- Size the activation timeout to the slowest legitimate startup, plus margin
When it happens
Trigger: Calling the kernel's candidate activation path where `astrid_runtime::time::timeout(activation_timeout, candidate.activate())` returns `Err(_)` (elapsed), i.e. `activate()` takes longer than 30s or hangs.
Common situations: Capsule startup blocked on slow I/O or network calls; deadlock or livelock inside the capsule's activation routine; overloaded host making process init extremely slow; a capsule whose activate() awaits an external dependency that is unreachable.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
Related errors
- timed out waiting for capsule command result
- candidate generation for '{id}' did not signal ready within
- bus admin request timed out after {:?} waiting for {want_res
- no loaded capsule handles the registry request for caller
- cannot remove capsule authority while an install transaction
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/64493c5b6cf912cb.
Report an issue: GitHub.