{"record":{"id":"2bf1404a71449059","repo":"xai-org/grok-build","slug":"mount-table-inconclusive-for-refusing-remove","errorCode":null,"errorMessage":"mount table inconclusive for {}; refusing remove","messagePattern":"mount table inconclusive for (.+?); refusing remove","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-fast-worktree/src/nfs/remove.rs","lineNumber":17,"sourceCode":"//! NFS worktree removal: daemon-first, verified-unmount, then confined backing delete.\n//!\n//! Never `umount -f`. Unverifiable unmount retains backing + pin.\nuse super::NfsWorktreeOpts;\nuse super::client::NfsWorktreeClient;\nuse super::confined::is_safe_worktree_id;\nuse super::liveness::{BACKING_MARKER_FILE, BackingMarker};\nuse super::mount_table::{dest_is_mountpoint, dest_is_projected_mount};\nuse crate::RemoveReport;\nuse anyhow::Context;\nuse anyhow::{Result, bail};\nuse std::io::Read;\nuse std::path::{Path, PathBuf};\nuse std::process::Stdio;\npub fn try_nfs_remove(worktree_path: &Path) -> Result<Option<RemoveReport>> {\n    if !dest_is_mountpoint(worktree_path) && !super::dest_is_known_unmounted(worktree_path) {\n        bail!(\n            \"mount table inconclusive for {}; refusing remove\",\n            worktree_path.display()\n        );\n    }\n    let is_projected = dest_is_projected_mount(worktree_path);\n    if is_projected {\n        if lookup_from_markers(worktree_path).is_none() {\n            bail!(\n                \"{} is a live grove mount without a backing marker; refusing rm -rf\",\n                worktree_path.display()\n            );\n        }\n    } else if dest_is_mountpoint(worktree_path) || lookup_nfs_meta(worktree_path).is_none() {\n        return Ok(None);\n    }\n    remove_nfs_worktree(worktree_path)\n}\nfn remove_nfs_worktree(worktree_path: &Path) -> Result<Option<RemoveReport>> {","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-fast-worktree/src/nfs/remove.rs#L1-L35","documentation":"try_nfs_remove only removes a worktree if it can prove the destination is currently a mountpoint or is a known previously-unmounted grove dest. If neither check succeeds, the mount table state is ambiguous, and it refuses to remove rather than risk deleting a normal directory or a victim backing directory.","triggerScenarios":"Calling try_nfs_remove on a path that is not a mountpoint and has no record in the known-unmounted table (e.g. already fully removed, never an NFS worktree, or /proc/mounts / dest_is_mountpoint lookup transiently failed).","commonSituations":"Removing a worktree twice (second call sees nothing mounted); path passed is the backing source dir instead of the dest mountpoint; sandboxed environments where the mount table is unreadable/incomplete (no private mount namespace).","solutions":["Verify the path is the grove dest mountpoint (mount | grep <path>) before calling try_nfs_remove","Ensure the path was created by the grove NFS flow; use the regular rm/remove path for non-NFS worktrees","If it was already unmounted by the daemon, just remove the backing directory manually instead","Check that the process can read the mount table (permissions/namespace) so dest_is_known_unmounted works"],"exampleFix":"// before\nstd::fs::remove_dir_all(&path).ok();\n// after\nmatch try_nfs_remove(&path) {\n    Ok(Some(report)) => println!(\"removed nfs worktree: {:?}\", report),\n    Ok(None) => std::fs::remove_dir_all(&path)?,\n    Err(e) => eprintln!(\"refused: {e}\"),\n}","handlingStrategy":"try-catch","validationCode":"fn removable(path: &Path) -> bool {\n    dest_is_mountpoint(path) || super::dest_is_known_unmounted(path)\n}\nif !removable(&path) { eprintln!(\"{} is not a grove dest; use plain rm\", path.display()); }","typeGuard":null,"tryCatchPattern":"match try_nfs_remove(&path) {\n    Ok(Some(report)) => { /* nfs removal done */ }\n    Ok(None) => { /* plain directory: rm -rf */ }\n    Err(e) if e.to_string().starts_with(\"mount table inconclusive\") => {\n        eprintln!(\"verify the path is a grove dest before removing\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Only call try_nfs_remove on paths created by the grove flow","Don't call twice for the same dest","Ensure /proc/mounts is readable (correct namespace/permissions)"],"tags":["mount","safety-guard","nfs","remove"],"backgroundTag":"mount-table-inconclusive","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}