{"record":{"id":"8226fcc4e3e25153","repo":"Hmbown/CodeWhale","slug":"log-file-missing","errorCode":null,"errorMessage":"log file missing: {}","messagePattern":"log file missing: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":941,"sourceCode":"                        println!(\"{attach}\");\n                        bail!(\"tmux attach unavailable\");\n                    }\n                }\n            } else {\n                println!(\"{attach}\");\n                Ok(())\n            }\n        }\n        LaneCommand::Logs {\n            lane_id,\n            follow,\n            tail,\n        } => {\n            let reg = LaneRegistry::open_default()?;\n            let lane = reg.load(&lane_id)?;\n            let path = lane.log_path;\n            if !path.exists() {\n                bail!(\"log file missing: {}\", path.display());\n            }\n            let content = std::fs::read(&path)?;\n            let lines: Vec<&[u8]> = content\n                .split(|byte| *byte == b'\\n')\n                .filter(|line| !line.is_empty())\n                .collect();\n            let start = lines.len().saturating_sub(tail);\n            let mut stdout = std::io::stdout().lock();\n            for line in &lines[start..] {\n                stdout.write_all(String::from_utf8_lossy(line).as_bytes())?;\n                stdout.write_all(b\"\\n\")?;\n            }\n            stdout.flush()?;\n            if !follow {\n                return Ok(());\n            }\n            let mut file = std::fs::File::open(&path)?;\n            file.seek(std::io::SeekFrom::End(0))?;","sourceCodeStart":923,"sourceCodeEnd":959,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/cli/src/lib.rs#L923-L959","documentation":"Thrown by `codewhale lane logs` after the lane is successfully loaded from the LaneRegistry, but `lane.log_path` does not exist on disk. It means the registry entry is intact while the log artifact it points to is gone — the error message includes the full missing path. Reading the file would otherwise fail with a raw OS error, so Codewhale fails fast with an explicit message.","triggerScenarios":"`codewhale lane logs <lane-id>` where the lane's log file was deleted, the workspace/state directory was cleaned (tmpfiles.d, `codewhale` state cleanup, manual rm), the lane was created but its process never started writing, or the state directory moved between machines.","commonSituations":"System reboot wiped /tmp-based state; user ran a cleanup of ~/.local/state or the codewhale home; lane created on another machine or in another checkout and the registry was copied without log files; disk-full or crash before the first log write.","solutions":["Verify the exact path from the error message exists' parent directory and check whether the file was rotated or deleted","Confirm the lane id: run the lane list command and re-run logs with the correct id","If state was wiped, recreate the lane (`codewhale lane start/...`) to regenerate logs","Check that the same user/workspace context owns the state dir (not a different HOME)"],"exampleFix":"# before\n$ codewhale lane logs stale-lane\n# log file missing: /home/user/.local/state/codewhale/lanes/stale-lane/log\n\n# after: re-create the lane so a fresh log exists\n$ codewhale lane start --name stale-lane ...\n$ codewhale lane logs stale-lane","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nlane_id=\"my-lane\"\n# check registry entry resolves and log exists before asking for logs\ncodewhale lane list | grep -q \"$lane_id\" || { echo \"unknown lane\" >&2; exit 1; }\nlog=\"$(codewhale lane list --json 2>/dev/null | jq -r --arg id \"$lane_id\" '.[] | select(.id==$id) | .log_path')\"\n[ -f \"$log\" ] || { echo \"log missing, recreate lane\" >&2; exit 1; }\ncodewhale lane logs \"$lane_id\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat lane state as disposable: recreate lanes rather than expecting logs to survive cleanup","Exclude codewhale state directories from tmp-cleaners (systemd-tmpfiles, find -delete) if lane history matters","After reboots or disk cleanup, run the lane list command before referencing logs"],"tags":["lane","logs","file-not-found","state"],"backgroundTag":"file-not-found","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}