{"record":{"id":"2eeace229c961b52","repo":"astrid-runtime/astrid","slug":"fuse-service-mountpoint-is-already-mounted","errorCode":null,"errorMessage":"FUSE service mountpoint is already mounted","messagePattern":"FUSE service mountpoint is already mounted","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/service.rs","lineNumber":266,"sourceCode":"        || mountpoint.parent().is_none()\n    {\n        bail!(\"FUSE service mountpoint is malformed\");\n    }\n    if mountpoint == resource_path\n        || mountpoint.starts_with(resource_path)\n        || resource_path.starts_with(mountpoint)\n    {\n        bail!(\"FUSE service mountpoint overlaps the lease resource\");\n    }\n    platform_fs::validate_private_directory(mountpoint)\n        .context(\"validate private FUSE service mountpoint\")?;\n    platform_fs::verify_no_redirects(mountpoint)\n        .context(\"reject redirected FUSE service mountpoint\")?;\n    if std::fs::read_dir(mountpoint)?.next().is_some() {\n        bail!(\"FUSE service mountpoint is not empty\");\n    }\n    if mountpoint::mountinfo_contains(mountpoint)? {\n        bail!(\"FUSE service mountpoint is already mounted\");\n    }\n    Ok(())\n}\n\nfn validate_control_path(control_path: &Path, resource_path: &Path) -> Result<()> {\n    if !control_path.is_absolute()\n        || control_path\n            .components()\n            .any(|component| matches!(component, std::path::Component::ParentDir))\n    {\n        bail!(\"FUSE service control path is malformed\");\n    }\n    if control_path != resource_path.join(\"process-control.sock\") {\n        bail!(\"FUSE service control path is not the kernel endpoint\");\n    }\n    let parent = control_path\n        .parent()\n        .context(\"FUSE service control path has no parent\")?;","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/service.rs#L248-L284","documentation":"validate_mountpoint consults mountinfo (via mountpoint::mountinfo_contains) to confirm the mountpoint is not already an active mount point. Launching FUSE over an existing mount would stack filesystems and break teardown expectations, so the launch is refused.","triggerScenarios":"Calling validate_launch when the kernel mount table (/proc/self/mountinfo) already lists the mountpoint path as a mounted filesystem — typically a prior FUSE mount that was never unmounted.","commonSituations":"A previous service instance is still running with the same mountpoint; an unmount failed or was skipped during shutdown; double-starting the service (e.g. systemd unit restarted while the old process lingers).","solutions":["Unmount the existing filesystem at the mountpoint (fusermount -u <mountpoint>) and retry","Stop the previous FUSE service instance before launching a new one with the same mountpoint","Check /proc/self/mountinfo (or `mountpoint <path>`) before launching to confirm the path is free","Use a unique mountpoint per service instance to avoid collisions"],"exampleFix":"# before: launching while old mount persists\n$ fusermount -u /run/astrid/mounts/demo\n# after the mount is gone, relaunch the service","handlingStrategy":"validation","validationCode":"let mounted = std::fs::read_to_string(\"/proc/self/mountinfo\")?\n    .lines()\n    .any(|l| l.split_whitespace().nth(3) == Some(mountpoint.to_str().unwrap()));\nif mounted { /* unmount first */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `mountpoint <path>` before launching","Ensure supervisors unmount on shutdown/restart","Use unique mountpoints per instance"],"tags":["fuse","mount","already-mounted","stale-state"],"backgroundTag":"address-already-in-use","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}