{"record":{"id":"44683886a04c15e2","repo":"astrid-runtime/astrid","slug":"registered-fuse-service-access-access-does-not","errorCode":null,"errorMessage":"registered FUSE service access {access:?} does not match its lease","messagePattern":"registered FUSE service access (.+?) does not match its lease","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/main.rs","lineNumber":823,"sourceCode":"        return Ok(());\n    };\n    let status = kernel_lease_status(client, &record.mount_id).await?;\n    let Some(status) = status else {\n        cleanup_stale_record(client, acting_principal, &record).await?;\n        return Ok(());\n    };\n    validate_record(&record, &status)?;\n    match call_control(\n        &record.control_path,\n        &ControlRequest::Status {\n            requested_by: record.requested_by.clone(),\n        },\n    ) {\n        Ok(ControlResponse::Status { access }) if access == status.access => {\n            bail!(\"mountpoint is already mounted: {}\", mountpoint.display())\n        },\n        Ok(ControlResponse::Status { access }) => {\n            bail!(\"registered FUSE service access {access:?} does not match its lease\")\n        },\n        Ok(_) => bail!(\"registered FUSE service returned an incompatible status response\"),\n        Err(_) => {\n            cleanup_stale_record(client, acting_principal, &record).await?;\n            Ok(())\n        },\n    }\n}\n\nasync fn cleanup_stale_record(\n    client: &mut AdminClient,\n    acting_principal: &astrid_core::PrincipalId,\n    record: &registry::MountRecord,\n) -> Result<()> {\n    let lease_is_live = kernel_lease_status(client, &record.mount_id)\n        .await?\n        .is_some();\n    let _ = call_control(","sourceCodeStart":805,"sourceCodeEnd":841,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/main.rs#L805-L841","documentation":"When remounting a storage volume, the FUSE provider queries the already-running FUSE service for its status and compares the reported access identity with the access recorded in the existing mount lease. If a Status response comes back but the access does not match the lease, the mount state is inconsistent and the operation is aborted with this bail in crates/astrid-storage-provider-fuse/src/main.rs:823.","triggerScenarios":"Calling the mount/ensure-mounted path while another FUSE service instance is already registered on the control socket, and that instance reports a Status whose access differs from the lease held by the caller (e.g. a stale service from a previous session with different credentials).","commonSituations":"A leftover FUSE daemon from a crashed prior run is still bound to the control socket; two different OS users or principals mounted the same mountpoint; the lease file was regenerated with different access after the service started.","solutions":["Unmount the stale FUSE service (or kill the old daemon) and clean up the stale record, then retry the mount","Delete the stale mount record/lease and re-run the mount so a fresh lease with matching access is issued","Verify the acting principal matches the one that originally mounted the volume"],"exampleFix":"// before: retrying mount while a mismatched service is alive\nmount_storage(...)?; // panics/bails: access does not match its lease\n// after\nunmount_storage(...).ok(); // tear down stale service first\nmount_storage(...)?;","handlingStrategy":"validation","validationCode":"fn access_matches_lease(status_access: &Access, lease: &StorageMountLeaseV1) -> bool { status_access == &lease.access }","typeGuard":"fn is_matching_status(resp: &ControlResponse, expected: &Access) -> Option<Access> { match resp { ControlResponse::Status { access } if access == expected => Some(access.clone()), _ => None } }","tryCatchPattern":"match ensure_mounted(...) { Err(e) if e.to_string().contains(\"does not match its lease\") => { cleanup_stale_record(...).await?; ensure_mounted(...)? }, r => r? }","preventionTips":["Tear down stale FUSE daemons before remounting the same mountpoint","Keep one principal per mountpoint lease","Regenerate the lease whenever the service is restarted"],"tags":["fuse","mount","lease","state-mismatch"],"backgroundTag":"invalid-state-transition","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"}