{"record":{"id":"e6205acfa294f842","repo":"xai-org/grok-build","slug":"unmounted-dest-has-grove-metadata-without-a-wor","errorCode":null,"errorMessage":"unmounted dest {} has grove metadata without a worktree id; retaining pin and dest","messagePattern":"unmounted dest (.+?) has grove metadata without a worktree id; retaining pin and dest","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/codegen/xai-fast-worktree/src/nfs/remove.rs","lineNumber":65,"sourceCode":"        if lookup_from_markers(worktree_path).is_none() {\n            bail!(\n                \"{} is still a mountpoint without a grove marker; refusing umount/rm\",\n                worktree_path.display()\n            );\n        }\n        plain_umount(worktree_path)?;\n    }\n    if !super::dest_is_known_unmounted(worktree_path) {\n        bail!(\n            \"unmount of {} could not be verified (still mounted or mount table \\\n             inconclusive); retaining backing and pin\",\n            worktree_path.display()\n        );\n    }\n    let meta = lookup_nfs_meta(worktree_path);\n    if let Some(m) = meta.as_ref() {\n        let Some(id) = m.worktree_id.as_deref() else {\n            bail!(\n                \"unmounted dest {} has grove metadata without a worktree id; \\\n                 retaining pin and dest\",\n                worktree_path.display()\n            );\n        };\n        if !is_safe_worktree_id(id) {\n            bail!(\n                \"unmounted dest {} has unsafe worktree id {id:?}; retaining pin and dest\",\n                worktree_path.display()\n            );\n        }\n        if let Some(src) = m.source.as_ref() {\n            {\n                let _ = src;\n                bail!(\"pin delete requires grove\");\n            }\n        }\n        if let Some(data_dir) = m.data_dir.as_ref() {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-fast-worktree/src/nfs/remove.rs#L47-L83","documentation":"After a successful verified unmount, remove_nfs_worktree reads the grove metadata from the dest to find the worktree id needed to delete the daemon-side pin. If metadata exists but has no worktree id, the pin cannot be identified, so it bails and retains both the pin and the dest rather than leaking an orphan pin.","triggerScenarios":"Calling try_nfs_remove on an unmounted dest whose nfs meta file records grove metadata but lacks worktree_id — meta written by an older tool version, partially-written/corrupted meta, or hand-edited metadata.","commonSituations":"Upgrading from a version that didn't store worktree_id in nfs meta; meta file truncated by a crash; user copied the meta file from another dest.","solutions":["Patch the nfs meta file to include the correct worktree_id, then retry try_nfs_remove","Look up the pin manually (grove daemon/DB) via source path or dest and delete it with the admin path","If the pin is truly orphaned, remove the dest and the meta manually and clean orphan pins via gc_orphan_pins on a grove-enabled build"],"exampleFix":"// before\nlet meta = lookup_nfs_meta(&dest).unwrap(); // meta lacks worktree_id\nremove_pin_for(&dest)?;\n// after\nlet mut meta = lookup_nfs_meta(&dest).expect(\"meta\");\nmeta.worktree_id = Some(id_from_daemon_or_db); // repair metadata\nwrite_nfs_meta(&dest, &meta)?;\ntry_nfs_remove(&dest)?;","handlingStrategy":"validation","validationCode":"if let Some(m) = lookup_nfs_meta(&dest) {\n    if m.worktree_id.as_deref().map_or(true, |id| !is_safe_worktree_id(id)) {\n        eprintln!(\"dest meta lacks a usable worktree_id; repair metadata before removal\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit or truncate nfs meta files","Ensure upgrades migrate meta to the current schema (with worktree_id)","Record the worktree id elsewhere (DB) as a backup for pin cleanup"],"tags":["metadata","pin","nfs","data-integrity"],"backgroundTag":"missing-worktree-id","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}