{"record":{"id":"a936591bf54039b1","repo":"xai-org/grok-build","slug":"out-of-disk-context","errorCode":null,"errorMessage":"OUT_OF_DISK_CONTEXT","messagePattern":"OUT_OF_DISK_CONTEXT","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/codegen/xai-fast-worktree/src/nfs/mod.rs","lineNumber":201,"sourceCode":"            }\n            if let Some(b) = backing {\n                grove[\"backing\"] = serde_json::Value::String(b);\n            }\n            let metadata = serde_json::json!({ \"grove\": grove });\n            Ok(Some(CreateWorktreeResult {\n                worktree_path: adopted.dest,\n                commit,\n                copy_stats: CopyStats::default(),\n                ignored_stats: None,\n                dirty_files_report: None,\n                resolved_strategy: grove_resolved_strategy(&adopted.transport),\n                strategy_metadata: Some(metadata),\n            }))\n        }\n        Ok(NfsCreateDecision::Fallback) => Ok(None),\n        Err(NfsTryError::StorageFull) => {\n            let err = std::io::Error::from(std::io::ErrorKind::StorageFull);\n            Err(anyhow::Error::new(err).context(OUT_OF_DISK_CONTEXT))\n        }\n        Err(NfsTryError::InFlight { phase }) => Err(anyhow::anyhow!(\n            \"nfs worktree create still in progress (phase={phase}); not falling back to copy\"\n        )),\n        Err(NfsTryError::IdentityConflict(msg)) => {\n            Err(anyhow::anyhow!(\"{msg}; not falling back to copy\"))\n        }\n        Err(NfsTryError::Other(e)) => Err(e).context(\"nfs worktree create failed\"),\n    }\n}\n/// Adopt succeeded but dest HEAD is unreadable. Tear the mount down so dest\n/// is not left projected with no worktrees.db row. Copy-fallback only when\n/// dest is known unmounted.\nfn teardown_after_failed_head_read(\n    client: &NfsWorktreeClient,\n    dest: &Path,\n    head_err: anyhow::Error,\n) -> Result<Option<CreateWorktreeResult>> {","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-fast-worktree/src/nfs/mod.rs#L183-L219","documentation":"In `try_grove_worktree`, when the NFS attempt reports NfsTryError::StorageFull, the error is converted to io::ErrorKind::StorageFull and wrapped with the OUT_OF_DISK_CONTEXT context string. It tells callers that the grove/NFS-backed worktree store has no space left, and (per the design) that this specific failure should trigger the copy-based fallback rather than being a generic bug.","triggerScenarios":"Calling the worktree-create path that routes through the NFS grove when the underlying NFS volume is out of space (NfsTryError::StorageFull returned from the daemon or client checks).","commonSituations":"Shared NFS server disk quota exhausted; runaway accumulation of worktrees/snapshots on the grove volume; quota per-user limits hit on a multi-tenant NFS export.","solutions":["Fall back to the copy-based worktree creation path (try_grove_worktree returns the error precisely so callers can do this).","Free space on the NFS grove volume: prune old worktrees and snapshots, or expand the volume/quota.","Monitor grove disk usage and alert before exhaustion (df/quota checks in ops).","Check for a single user/job filling the volume and throttle it."],"exampleFix":"// before\nlet wt = try_grove_worktree(req).await?;\n// after\nlet wt = match try_grove_worktree(req).await {\n    Ok(Some(wt)) => wt,\n    Ok(None) | Err(e) if e.root_cause().to_string().contains(\"OUT_OF_DISK_CONTEXT\") => {\n        tracing::warn!(\"grove out of disk; falling back to copy\");\n        create_by_copy(req).await?\n    }\n    Err(e) => return Err(e),\n};","handlingStrategy":"fallback","validationCode":"// approximate pre-check before requesting an NFS grove worktree\nlet avail = statvfs(NFS_MOUNT)?.available_bytes();\nif avail < MIN_WORKTREE_BYTES { skip_grove_and_use_copy(); }","typeGuard":"fn is_out_of_disk_context(err: &anyhow::Error) -> bool {\n    err.chain().any(|c| c.to_string().contains(\"OUT_OF_DISK_CONTEXT\"))\n        || err.root_cause().downcast_ref::<io::Error>()\n            .map_or(false, |e| e.kind() == io::ErrorKind::StorageFull)\n}","tryCatchPattern":"match try_grove_worktree(req).await {\n    Ok(Some(wt)) => wt,\n    Ok(None) => create_by_copy(req).await?,\n    Err(e) if is_out_of_disk_context(&e) => create_by_copy(req).await?,\n    Err(e) => return Err(e),\n}","preventionTips":["Monitor grove NFS volume free space/quota and alert before exhaustion","Prune old worktrees and snapshots on a schedule","Always keep the copy-based creation path available as a fallback","Throttle jobs that create many worktrees concurrently"],"tags":["disk-full","nfs","storage","worktree"],"backgroundTag":"out-of-disk-space","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}