{"record":{"id":"345966a461595393","repo":"astrid-runtime/astrid","slug":"detached-fuse-service-readiness-access-access","errorCode":null,"errorMessage":"detached FUSE service readiness access {access:?} does not match its lease","messagePattern":"detached FUSE service readiness access (.+?) does not match its lease","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/main.rs","lineNumber":340,"sourceCode":"        mountpoint::lazy_unmount(&launch.mountpoint),\n        || {\n            cleanup_service_artifacts(\n                control_path,\n                &launch.mountpoint,\n                launch.auto_created_mountpoint,\n            )\n        },\n    )\n}\n\nfn require_ready_control_response(\n    response: ControlResponse,\n    expected_access: StorageProviderAccessV1,\n) -> Result<()> {\n    match response {\n        ControlResponse::Status { access } if access == expected_access => Ok(()),\n        ControlResponse::Status { access } => {\n            bail!(\"detached FUSE service readiness access {access:?} does not match its lease\")\n        },\n        ControlResponse::Failure { code, message } => {\n            bail!(\"detached FUSE service readiness failed [{code}]: {message}\")\n        },\n        ControlResponse::Done => {\n            bail!(\"detached FUSE service returned an incompatible readiness response\")\n        },\n    }\n}\n\nasync fn sync(\n    client: &mut AdminClient,\n    acting_principal: &astrid_core::PrincipalId,\n    selector: &StorageMountSelectorV1,\n) -> Result<StorageProviderSuccessV1> {\n    let record = registry::resolve_record(selector)?;\n    let status = require_live_lease(client, acting_principal, &record).await?;\n    validate_record(&record, &status)?;","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/main.rs#L322-L358","documentation":"This error means the detached FUSE service answered a readiness probe with a `ControlResponse::Status` whose `access` does not equal the `StorageProviderAccessV1` from the lease being served. The library requires the live service to report exactly the access configuration the lease prescribed; any mismatch means the mount could enforce the wrong permissions. It is thrown from the readiness validation helper in main.rs:340.","triggerScenarios":"Calling the readiness check with a `ControlResponse::Status` whose embedded access differs from `expected_access` — e.g. read-only vs read-write, different owner, or different lease token.","commonSituations":"A stale service from a previous mount still holding the control socket; the service was started with different access parameters than the current lease; lease/access structs differing by field ordering or an updated type after a version change.","solutions":["Stop the stale detached service (cleanup_service_artifacts) and start a fresh one from the current lease.","Compare the lease's access fields with what the service was started with and correct the mismatch.","Delete leftover control sockets/mountpoints from previous runs so an old service cannot answer readiness probes.","Verify no serde representation drift (same crate version on both sides) makes equal accesses compare unequal."],"exampleFix":"// before\nlet svc = reuse_existing_service(&sock)?;\nvalidate_readiness(status, &lease.access)?;\n// after\ncleanup_service_artifacts(&sock, &mp)?;\nlet svc = start_detached_service(&lease)?;\nvalidate_readiness(status, &lease.access)?;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn matches_lease(status: &ControlResponse, access: &StorageProviderAccessV1) -> bool {\n    matches!(status, ControlResponse::Status { access: a } if a == access)\n}","tryCatchPattern":"match validate_readiness(resp, &lease.access) {\n    Err(e) if e.to_string().contains(\"does not match its lease\") => {\n        cleanup_service_artifacts(&sock, &mp)?;\n        // restart service from current lease\n    }\n    r => r?,\n}","preventionTips":["Clean up stale control sockets and services before starting a new mount","Start the service from the same lease object you validate against","Keep serde structs identical across client and service versions"],"tags":["fuse","lease","access-control","readiness"],"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-14T05:17:10.506Z"}