{"record":{"id":"ed62753d29569220","repo":"astrid-runtime/astrid","slug":"kernel-returned-an-unexpected-storage-mount-respon-ed6275","errorCode":null,"errorMessage":"kernel returned an unexpected storage mount response","messagePattern":"kernel returned an unexpected storage mount response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/main.rs","lineNumber":898,"sourceCode":"    }\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,\n        require_service_running_after_handoff,","sourceCodeStart":880,"sourceCodeEnd":916,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/main.rs#L880-L916","documentation":"lease_from_response expects the kernel to answer a mount-lease request with AdminResponseBody::StorageMountLease or AdminResponseBody::Error. Any other AdminResponseBody variant (e.g. Success) is unexpected, so it bails with this message (crates/astrid-storage-provider-fuse/src/main.rs:898).","triggerScenarios":"Sending a mount-lease request and getting a response body of the wrong variant — typically a client/server version mismatch or the request being routed to an endpoint that returns a generic Success.","commonSituations":"Version skew between the FUSE provider and the kernel admin API; a proxy or misconfiguration routing the lease request to the wrong endpoint; request/response shape changed after an upgrade.","solutions":["Upgrade the FUSE provider and kernel to matching versions so AdminResponseBody variants align","Confirm the request targets the storage-mount-lease endpoint and not a generic action endpoint","Capture the raw response body in logs and verify its variant before parsing"],"exampleFix":"// before\nlet lease = lease_from_response(send(request).body)?; // unexpected variant\n// after\nlet body = send(request).body;\nassert_matches!(body, AdminResponseBody::StorageMountLease(_) | AdminResponseBody::Error(_));\nlet lease = lease_from_response(body)?;","handlingStrategy":"type-guard","validationCode":"let ok = matches!(body, AdminResponseBody::StorageMountLease(_) | AdminResponseBody::Error(_));","typeGuard":"fn is_lease_body(body: &AdminResponseBody) -> bool { matches!(body, AdminResponseBody::StorageMountLease(_) | AdminResponseBody::Error(_)) }","tryCatchPattern":"match lease_from_response(body) { Err(e) if e.to_string().contains(\"unexpected storage mount response\") => upgrade_client_to_match_kernel()?, r => r? }","preventionTips":["Upgrade provider and kernel together","Confirm endpoint routing for lease requests","Log raw response bodies on mismatch"],"tags":["kernel","mount","unexpected-response","version-mismatch"],"backgroundTag":"unexpected-api-response-shape","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"}