{"record":{"id":"f3e1c7a4138bf591","repo":"astrid-runtime/astrid","slug":"kernel-returned-an-unexpected-storage-lifecycle-re-f3e1c7","errorCode":null,"errorMessage":"kernel returned an unexpected storage lifecycle response","messagePattern":"kernel returned an unexpected storage lifecycle response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/main.rs","lineNumber":767,"sourceCode":"        .request(AdminRequestKind::StorageMountStatus {\n            mount_id: *mount_id,\n        })\n        .await?;\n    match body {\n        AdminResponseBody::Success(value) => {\n            let status =\n                serde_json::from_value(value).context(\"decode kernel storage mount status\")?;\n            Ok(Some(status))\n        },\n        AdminResponseBody::Error(error)\n            if error.contains(\"was not found\") || error.contains(\"expired or revoked\") =>\n        {\n            Ok(None)\n        },\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\nasync fn require_live_lease(\n    client: &mut AdminClient,\n    acting_principal: &astrid_core::PrincipalId,\n    record: &registry::MountRecord,\n) -> Result<LeaseStatus> {\n    if &record.requested_by != acting_principal {\n        bail!(\"mount was issued to another acting principal\");\n    }\n    kernel_lease_status(client, &record.mount_id)\n        .await?\n        .with_context(|| format!(\"storage mount lease {} is stale\", record.mount_id))\n}\n\nfn validate_record(record: &registry::MountRecord, status: &LeaseStatus) -> Result<()> {\n    if status.mountpoint != record.mountpoint || status.access != record.access {","sourceCodeStart":749,"sourceCodeEnd":785,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/main.rs#L749-L785","documentation":"kernel_lease_status matches the admin response against AdminResponseBody::Success and AdminResponseBody::Error; any other AdminResponseBody variant (catch-all _) is a response shape the provider doesn't understand, so it bails. This guards against kernel/provider protocol drift where new response variants exist but the FUSE provider binary predates them.","triggerScenarios":"The kernel admin endpoint returns a new/unknown AdminResponseBody variant for StorageMountStatus — typically a version mismatch between kernel and provider binaries, or a proxy rewriting the response.","commonSituations":"Rolling upgrade where the kernel is newer than the FUSE provider (or vice versa); a test kernel build emitting an extra variant; mixed-version deployments after an update.","solutions":["Rebuild/redeploy the FUSE provider and kernel from the same source revision so AdminResponseBody variants match","Log the raw response body to identify which unexpected variant the kernel returned","Pin kernel and provider versions in deployment so they upgrade together","Add an explicit match arm for the new variant in kernel_lease_status if it represents a legitimate state"],"exampleFix":"// before\n_ => bail!(\"kernel returned an unexpected storage lifecycle response\"),\n// after: handle the new variant explicitly\nAdminResponseBody::Pending { retry_after } => { /* handle */ }\n_ => bail!(\"kernel returned an unexpected storage lifecycle response\"),","handlingStrategy":"type-guard","validationCode":"// Detect version drift before calling lifecycle APIs\nlet caps = client.request(AdminRequestKind::Handshake).await?;\nif caps.protocol_version != PROVIDER_PROTOCOL_VERSION {\n    return Err(anyhow!(\"kernel/provider protocol mismatch: {} vs {}\", caps.protocol_version, PROVIDER_PROTOCOL_VERSION));\n}","typeGuard":"fn is_known_response(body: &AdminResponseBody) -> bool {\n    matches!(body, AdminResponseBody::Success(_) | AdminResponseBody::Error(_))\n}","tryCatchPattern":"match kernel_lease_status(client, &mount_id).await {\n    Err(e) if e.to_string().contains(\"unexpected storage lifecycle response\") => {\n        log_raw_response_for_diagnostics();\n        // redeploy provider and kernel from the same revision, then retry\n    }\n    other => other,\n}","preventionTips":["Deploy kernel and provider binaries from the same source revision; pin versions together","Log the raw admin response body when this error fires to identify the unknown variant","Add explicit match arms for newly introduced AdminResponseBody variants instead of relying on the catch-all","Smoke-test the admin handshake in CI across version-matrix combinations"],"tags":["kernel","ipc","protocol","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-14T05:17:10.506Z"}