{"record":{"id":"827e5fd7648b0940","repo":"zeroclaw-labs/zeroclaw","slug":"low-disk-space-only-avail-mb-mb-available","errorCode":null,"errorMessage":"low disk space: only {avail_mb} MB available","messagePattern":"low disk space: only (.+?) MB available","errorType":"console","errorClass":"DiagItem","httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-runtime/src/doctor/mod.rs","lineNumber":1511,"sourceCode":"            }\n        }\n        Err(e) => {\n            items.push(DiagItem::error(\n                cat,\n                format!(\"directory is not writable: {e}\"),\n            ));\n        }\n    }\n\n    // Disk space (best-effort via `df`)\n    if let Some(avail_mb) = disk_available_mb(ws) {\n        if avail_mb >= 100 {\n            items.push(DiagItem::ok(\n                cat,\n                format!(\"disk space: {avail_mb} MB available\"),\n            ));\n        } else {\n            items.push(DiagItem::warn(\n                cat,\n                format!(\"low disk space: only {avail_mb} MB available\"),\n            ));\n        }\n    }\n\n    let mut agent_aliases: Vec<&String> = config.agents.keys().collect();\n    agent_aliases.sort();\n    for alias in agent_aliases {\n        let agent = config.agents.get(alias).expect(\"alias from keys()\");\n        if !agent.enabled {\n            continue;\n        }\n        let agent_ws = config.agent_workspace_dir(alias);\n        check_agent_file(&agent_ws, \"SOUL.md\", alias, cat, items);\n        check_agent_file(&agent_ws, \"AGENTS.md\", alias, cat, items);\n    }\n}","sourceCodeStart":1493,"sourceCodeEnd":1529,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/doctor/mod.rs#L1493-L1529","documentation":"A `zeroclaw doctor` warning from `check_workspace`: the filesystem holding `data_dir` reports fewer than 100 MB available (measured best-effort by shelling out to `df -m <data_dir>`). Low disk threatens session logs, state files, and probe writes before the OS returns ENOSPC. If `df` is unavailable the check is silently skipped, so seeing the warning means `df` ran and reported under the 100 MB threshold.","triggerScenarios":"Running `zeroclaw doctor` when `df -m <data_dir>` reports < 100 MB available — typically a full root partition, a small tmpfs/container volume, or a quota-backed home directory.","commonSituations":"Long-running daemon accumulating session logs on a small VPS; container with a small writable layer; CI runner with a nearly full disk; `/tmp` mounted small with `data_dir` pointing into it.","solutions":["Free space on the filesystem holding `data_dir` (clear logs/caches, remove old session data).","Or relocate `data_dir` in config to a volume with headroom.","Set up a disk-space alert/monitor so the daemon never reaches this state.","Re-run `zeroclaw doctor` and confirm it now reports `disk space: N MB available` as ok."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let out = std::process::Command::new(\"df\").arg(\"-m\").arg(&config.data_dir).output()?;\nlet avail_mb: u64 = String::from_utf8_lossy(&out.stdout)\n    .lines().rev().find(|l| !l.trim().is_empty())\n    .and_then(|l| l.split_whitespace().nth(3)?.parse().ok())\n    .unwrap_or(0);\nassert!(avail_mb >= 100, \"data_dir filesystem has only {avail_mb} MB free\");","typeGuard":null,"tryCatchPattern":"// Best-effort, same posture as doctor: skip the check when df is unavailable\nif let Some(avail_mb) = disk_available_mb(&config.data_dir) {\n    if avail_mb < 100 { /* alert / refuse to start heavy jobs */ }\n}","preventionTips":["Monitor free space on the data_dir filesystem with the same 100 MB threshold doctor uses.","Cap or rotate session logs and state artifacts so the daemon cannot fill the disk."],"tags":["workspace","disk-space","doctor","operations","zeroclaw"],"backgroundTag":"no-space-left-on-device","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}