astrid-runtime/astrid · error

kernel refused storage lifecycle request: {error}

Error message

kernel refused storage lifecycle request: {error}

What it means

The fskit provider sent a storage lifecycle admin request (mount, revoke, etc.) to the kernel over the AdminClient, and the kernel replied with an explicit AdminResponseBody::Error. The provider surfaces the kernel's own error text verbatim after a fixed prefix, so the root cause string comes from the kernel side.

Source

Thrown at crates/astrid-storage-provider-fskit/src/main.rs:301

    if !lease_is_live && requested_by != acting_principal {
        bail!("stale mount recovery belongs to another acting principal");
    }
    Ok(())
}

fn lease_from_response(body: AdminResponseBody) -> Result<StorageMountLeaseV1> {
    match body {
        AdminResponseBody::StorageMountLease(lease) => Ok(*lease),
        AdminResponseBody::Error(error) => bail!("kernel refused storage mount: {error}"),
        _ => bail!("kernel returned an unexpected storage mount response"),
    }
}

fn into_success(body: AdminResponseBody) -> Result<serde_json::Value> {
    match body {
        AdminResponseBody::Success(value) => Ok(value),
        AdminResponseBody::Error(error) => {
            bail!("kernel refused storage lifecycle request: {error}")
        },
        _ => bail!("kernel returned an unexpected storage lifecycle response"),
    }
}

fn unmount_status(body: AdminResponseBody) -> Result<bool> {
    match body {
        AdminResponseBody::Success(_) => Ok(true),
        AdminResponseBody::Error(error)
            if error.contains("was not found") || error.contains("expired or revoked") =>
        {
            Ok(false)
        },
        AdminResponseBody::Error(error) => {
            bail!("kernel refused storage unmount authorization: {error}")
        },
        _ => bail!("kernel returned an unexpected storage unmount response"),
    }

View on GitHub (pinned to affd8760f4)

Solutions

  1. Read the {error} text embedded in the message; it names the kernel-side cause (e.g. lease 'was not found', 'expired or revoked').
  2. Check whether the mount lease was already revoked or expired (call StorageMountStatus first, or treat 'was not found'/'expired or revoked' as already-unmounted).
  3. Re-run mount to obtain a fresh lease, then retry the lifecycle operation with the new mount_id.
  4. If the refusal is a permission issue, retry as the principal that originally requested the mount (requested_by).

Example fix

// before: blind revoke that may hit an expired lease
let body = client.request(AdminRequestKind::StorageMountRevoke { mount_id }).await?;
into_success(body)?;
// after: skip revoke when the lease is already gone
let status = unmount_status(client.request(AdminRequestKind::StorageMountStatus { mount_id }).await?)?;
if status {
    into_success(client.request(AdminRequestKind::StorageMountRevoke { mount_id }).await?)?;
}
Defensive patterns

Strategy: try-catch

Validate before calling

let status = unmount_status(client.request(AdminRequestKind::StorageMountStatus { mount_id }).await?)?;
if !status { return Ok(()); } // lease already gone; skip lifecycle call

Type guard

fn is_kernel_success(body: &AdminResponseBody) -> bool {
    matches!(body, AdminResponseBody::Success(_))
}

Try / catch

match into_success(body) {
    Err(e) if e.to_string().contains("was not found") || e.to_string().contains("expired or revoked") => Ok(()),
    Err(e) => return Err(e),
    Ok(v) => Ok(v),
}

Prevention

When it happens

Trigger: into_success() is called on responses to StorageMountRevoke (in unmount) and other lifecycle requests in execute(); any kernel-side rejection — unknown mount id, expired/revoked lease, permission denial, or internal kernel failure — returns AdminResponseBody::Error and is converted here via bail!.

Common situations: Unmounting a mount whose lease was already revoked by another process or an admin; stale lease id reused after kernel restart; kernel policy refusing revoke from a non-owning principal; kernel temporarily rejecting requests during shutdown.

Related errors


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