{"record":{"id":"3570edb9874c4ed2","repo":"astrid-runtime/astrid","slug":"kernel-refused-storage-mount-error-3570ed","errorCode":null,"errorMessage":"kernel refused storage mount: {error}","messagePattern":"kernel refused storage mount: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/main.rs","lineNumber":897,"sourceCode":"        },\n    }\n}\n\nfn cleanup_mountpoint(mountpoint: &Path, auto_created: bool) -> Result<()> {\n    if auto_created\n        && !mountpoint::mountinfo_contains(mountpoint)?\n        && std::fs::symlink_metadata(mountpoint).is_ok_and(|metadata| metadata.is_dir())\n        && std::fs::read_dir(mountpoint)?.next().is_none()\n    {\n        let _ = std::fs::remove_dir(mountpoint);\n    }\n    Ok(())\n}\n\nfn lease_from_response(body: AdminResponseBody) -> Result<StorageMountLeaseV1> {\n    match body {\n        AdminResponseBody::StorageMountLease(lease) => Ok(*lease),\n        AdminResponseBody::Error(error) => bail!(\"kernel refused storage mount: {error}\"),\n        _ => bail!(\"kernel returned an unexpected storage mount response\"),\n    }\n}\n\nfn into_success(body: AdminResponseBody) -> Result<serde_json::Value> {\n    match body {\n        AdminResponseBody::Success(value) => Ok(value),\n        AdminResponseBody::Error(error) => {\n            bail!(\"kernel refused storage lifecycle request: {error}\")\n        },\n        _ => bail!(\"kernel returned an unexpected storage lifecycle response\"),\n    }\n}\n\n#[cfg(test)]\nmod launcher_tests {\n    use super::{\n        ControlResponse, StorageProviderAccessV1, require_ready_control_response,","sourceCodeStart":879,"sourceCodeEnd":915,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/main.rs#L879-L915","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the {error} detail embedded in the message to see the kernel's actual rejection reason","Verify the volume identifier exists and the acting principal has mount permission","Fix the underlying cause (permissions, volume id, policy config) and re-request the mount lease"],"exampleFix":"// before\nlet lease = request_mount_lease(volume_id)?; // kernel refused: unknown volume\n// after\nlet lease = request_mount_lease(verified_volume_id)?; // validate volume exists first","handlingStrategy":"try-catch","validationCode":"if !volume_exists(&volume_id).await? { bail!(\"unknown volume {volume_id}\") }","typeGuard":"fn lease_or_error(body: &AdminResponseBody) -> Result<&StorageMountLeaseV1, &AdminError> { match body { AdminResponseBody::StorageMountLease(l) => Ok(l), AdminResponseBody::Error(e) => Err(e), _ => unreachable!() } }","tryCatchPattern":"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? }","preventionTips":["Validate volume IDs and permissions before requesting a lease","Keep kernel credentials current","Read the embedded kernel error detail before retrying"],"tags":["kernel","mount","lease","api-error"],"backgroundTag":"api-error-response","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}