{"record":{"id":"f12b464f4da52e41","repo":"xai-org/grok-build","slug":"is-a-live-grove-mount-without-a-backing-marker","errorCode":null,"errorMessage":"{} is a live grove mount without a backing marker; refusing rm -rf","messagePattern":"(.+?) is a live grove mount without a backing marker; refusing rm -rf","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/codegen/xai-fast-worktree/src/nfs/remove.rs","lineNumber":25,"sourceCode":"use 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>> {\n    let opts = nfs_opts_from_env_and_meta(None);\n    let client = NfsWorktreeClient::from_opts(&opts);\n    if client.ping() {\n        match client.remove_worktree(worktree_path, false) {\n            Ok(()) => return report_after_daemon_unmount(worktree_path),\n            Err(e) => {\n                bail!(\"daemon RemoveWorktree failed: {e}\");\n            }","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-fast-worktree/src/nfs/remove.rs#L7-L43","documentation":"When the dest is detected as a projected grove mount, removal requires a backing marker (recorded in the mount's markers). If lookup_from_markers finds no marker, the library cannot prove which backing directory this mount belongs to, so it refuses to rm -rf to protect against deleting an unrelated victim directory.","triggerScenarios":"Calling try_nfs_remove on a live projected mount whose marker lookup fails: markers were deleted/corrupted, the mount was created by an older version with a different marker layout, or the mount was planted outside the grove flow.","commonSituations":"Manually mounting a grove export without going through the tool; cleaning /tmp state that held marker metadata while the mount is still active; version upgrade changing the marker file format.","solutions":["Restore/repair the marker metadata (re-register the mount via the grove tooling) so lookup_from_markers resolves it","Unmount the mount first (plain_umount / umount <path>), then remove the backing directory explicitly","Verify the mount actually belongs to you before removing, then delete backing manually if the tool refuses"],"exampleFix":"// before\ntry_nfs_remove(&live_mount_path)?;\n// after\nlet _ = std::process::Command::new(\"umount\").arg(&live_mount_path).status()?;\nstd::fs::remove_dir_all(&live_mount_path)?; // only if you verified ownership","handlingStrategy":"validation","validationCode":"if dest_is_projected_mount(&path) && lookup_from_markers(&path).is_none() {\n    eprintln!(\"live mount without marker; umount manually after verifying ownership\");\n} else {\n    try_nfs_remove(&path)?;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never delete marker metadata while a mount is live","Create mounts only through the grove tooling so markers are registered","Before rm on a live mount, verify marker presence or umount first"],"tags":["safety-guard","mount","rm-rf","marker"],"backgroundTag":"missing-backing-marker","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}