astrid-runtime/astrid · critical · anyhow::Error

Failed to boot Kernel

Error message

Failed to boot Kernel: {e}

What it means

The daemon awaits `Kernel::boot(...)` with runtime limits, HTTP limits, and the workspace layout; if booting the kernel fails for any reason, the underlying error is wrapped as 'Failed to boot Kernel'. This is a startup-fatal error: without a booted kernel the daemon cannot serve capsules.

Solutions

  1. Read the chained source error (`{e}`) for the actual kernel boot failure cause.
  2. Verify the workspace root/layout is writable and not corrupted.
  3. Re-check `--capsule-*` limit flags and config/env values feeding resolve_capsule_limits; fix out-of-range values.
  4. Retry after fixing environment issues; if persistent, file a bug with the wrapped source error.
Defensive patterns

Strategy: try-catch

Try / catch

// rust
match daemon::run(args).await {
    Err(e) => { eprintln!("{e:#}"); /* inspect full chain for kernel boot cause */ std::process::exit(1); }
    Ok(()) => {}
}

Prevention

When it happens

Trigger: Calling daemon `run()` where the kernel boot future resolves to Err — e.g. invalid runtime_limits, http_limits, or workspace_layout arguments, or internal kernel initialization failure (storage, WasmEngine setup).

Common situations: Corrupt or unusable workspace layout; bad host-derived concurrency ceilings from CLI/config/env; an environment where kernel subsystem initialization fails (permissions, missing durable root).

Related errors


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

Appendix: source

Thrown at crates/astrid-daemon/src/lib.rs:266

    // Resolve the capsule host-call concurrency ceilings (CLI > config+env >
    // host-derived default); the kernel forwards them to every `WasmEngine`.
    // Done before `args.workspace` is consumed below.
    let runtime_limits = resolve_capsule_limits(&args, unified_cfg.as_ref());

    // Operator ceilings for the astrid:http host (global; absent `[http]`
    // config = the host's historical constants). Forwarded to every capsule.
    let http_limits = resolve_http_limits(unified_cfg.as_ref());
    let kernel = astrid_kernel::Kernel::new_with_workspace_layout(
        session_id.clone(),
        workspace_root,
        runtime_limits,
        std::collections::HashMap::new(),
        http_limits,
        workspace_layout,
    )
    .await
    .map_err(|e| anyhow::anyhow!("Failed to boot Kernel: {e}"))?;

    // Local egress is security policy at durable-root authority, so read it
    // only after admission and bind it once before any capsule can load.
    let admitted_config = astrid_config::Config::load_with_home_and_layout(
        Some(&kernel.workspace_root),
        astrid_home.root(),
        kernel.workspace_layout(),
    )
    .map_err(|error| anyhow::anyhow!("Failed to load admitted-home boot policy: {error:#}"))?;
    kernel
        .bind_boot_local_egress(admitted_config.config.security.capsule_local_egress)
        .map_err(|error| anyhow::anyhow!("Failed to bind boot policy: {error}"))?;

    if defer_logging {
        init_logging(&log_config);
    }
    kernel
        .set_system_capsules(

View on GitHub (pinned to affd8760f4)