astrid-runtime/astrid · error

kernel refused storage mount: {error}

Error message

kernel refused storage mount: {error}

What it means

lease_from_response converts an AdminResponseBody into a StorageMountLeaseV1. If the kernel (admin API) answers a mount-lease request with an AdminResponseBody::Error, the error is surfaced to the caller as "kernel refused storage mount: {error}" (crates/astrid-storage-provider-fuse/src/main.rs:897).

Source

Thrown at crates/astrid-storage-provider-fuse/src/main.rs:897

        },
    }
}

fn cleanup_mountpoint(mountpoint: &Path, auto_created: bool) -> Result<()> {
    if auto_created
        && !mountpoint::mountinfo_contains(mountpoint)?
        && std::fs::symlink_metadata(mountpoint).is_ok_and(|metadata| metadata.is_dir())
        && std::fs::read_dir(mountpoint)?.next().is_none()
    {
        let _ = std::fs::remove_dir(mountpoint);
    }
    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"),
    }
}

#[cfg(test)]
mod launcher_tests {
    use super::{
        ControlResponse, StorageProviderAccessV1, require_ready_control_response,

View on GitHub (pinned to affd8760f4)

Solutions

  1. Inspect the {error} detail embedded in the message to see the kernel's actual rejection reason
  2. Verify the volume identifier exists and the acting principal has mount permission
  3. Fix the underlying cause (permissions, volume id, policy config) and re-request the mount lease

Example fix

// before
let lease = request_mount_lease(volume_id)?; // kernel refused: unknown volume
// after
let lease = request_mount_lease(verified_volume_id)?; // validate volume exists first
Defensive patterns

Strategy: try-catch

Validate before calling

if !volume_exists(&volume_id).await? { bail!("unknown volume {volume_id}") }

Type guard

fn lease_or_error(body: &AdminResponseBody) -> Result<&StorageMountLeaseV1, &AdminError> { match body { AdminResponseBody::StorageMountLease(l) => Ok(l), AdminResponseBody::Error(e) => Err(e), _ => unreachable!() } }

Try / catch

match mount(...) { Err(e) if e.to_string().starts_with("kernel refused storage mount") => { let reason = extract_kernel_error(&e); apply_fix(reason)?; mount(...)? }, r => r? }

Prevention

When it happens

Trigger: Requesting a storage mount lease from the kernel/admin API and receiving an explicit error body — e.g. the mount is denied by policy, the volume does not exist, or the caller lacks permission.

Common situations: Mounting a volume the principal is not authorized for; requesting a lease for a deleted/unknown storage volume; policy configuration blocking the mount; expired credentials at the kernel.

Related errors


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