{"record":{"id":"5583dca95353c511","repo":"astrid-runtime/astrid","slug":"kernel-refused-storage-mount-error-5583dc","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-winfsp/src/main.rs","lineNumber":306,"sourceCode":"                .await?,\n        )?;\n    }\n    update_registry(|registry| {\n        registry.mounts.remove(&path_key(&record.mountpoint)?);\n        Ok(())\n    })?;\n    if record.auto_created_mountpoint {\n        let _ = std::fs::remove_dir(&record.mountpoint);\n    }\n    Ok(StorageProviderSuccessV1::Unmounted {\n        mount_id: record.mount_id,\n    })\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\nfn unmount_status(body: AdminResponseBody) -> Result<bool> {\n    match body {\n        AdminResponseBody::Success(_) => Ok(true),\n        AdminResponseBody::Error(error)","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-winfsp/src/main.rs#L288-L324","documentation":"After sending StorageMountIssue to the admin service, lease_from_response() expects an AdminResponseBody::StorageMountLease. If the kernel answers with AdminResponseBody::Error, the mount request was refused and the kernel's error is re-raised with this message; any other body variant is a separate unexpected-response error.","triggerScenarios":"mount() calls lease_from_response() on the StorageMountIssue reply and the kernel returned AdminResponseBody::Error — e.g. the view/access is invalid, the principal lacks mount permission, capacity/quota is exhausted, or the lease cannot be granted.","commonSituations":"Requesting a mount for a view that no longer exists or the principal cannot access; kernel-side quota or policy refusing new mounts; admin service degraded and replying with generic kernel errors; stale access credentials embedded in StorageProviderAccessV1.","solutions":["Inspect the {error} detail embedded in the message — it carries the kernel's actual refusal reason.","Verify the view exists and the acting principal holds the access rights in StorageProviderAccessV1.","Check kernel-side mount quotas/policy limits and free capacity if exhausted.","Re-authenticate / refresh credentials if the error indicates an authorization failure, then retry the mount."],"exampleFix":"// before: mount failure aborts launch with raw kernel error\nlet lease = lease_from_response(client.request(AdminRequestKind::StorageMountIssue { .. }).await?)?;\n// after: surface the kernel error and fall back\nlet lease = match lease_from_response(body) {\n    Ok(l) => l,\n    Err(e) => {\n        log::error!(\"kernel refused mount: {e}\");\n        return Err(anyhow!(\"cannot mount view: {e}; check principal access and quota\"));\n    },\n};","handlingStrategy":"try-catch","validationCode":"// Before issuing the mount, check the view is reachable and access is valid via an admin status call where available.","typeGuard":"// Rust\nfn lease_of(body: &AdminResponseBody) -> Option<&StorageMountLeaseV1> {\n    match body {\n        AdminResponseBody::StorageMountLease(l) => Some(l),\n        _ => None,\n    }\n}","tryCatchPattern":"// Caller\nmatch mount(client, view, access, requested).await {\n    Err(e) if e.to_string().starts_with(\"kernel refused storage mount\") => {\n        // parse the kernel error detail; fix access/quota and retry\n    }\n    other => other?,\n}","preventionTips":["Validate view existence and principal access rights before requesting a mount","Monitor kernel mount quotas and capacity","Refresh credentials regularly so access data stays valid"],"tags":["winfsp","kernel-refusal","mount","admin-api"],"backgroundTag":"upstream-api-error","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}