{"record":{"id":"8226fcc4e3e25153","repo":"Hmbown/CodeWhale","slug":"log-file-missing","errorCode":null,"errorMessage":"log file missing: {}","messagePattern":"log file missing: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":997,"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":979,"sourceCodeEnd":1015,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L979-L1015","documentation":"The `codewhale lane log` (tail) command resolves the lane via `LaneRegistry::open_default`, reads `lane.log_path`, and bails if that file does not exist before reading and splitting its content into lines. It is thrown because tailing a non-existent log is indistinguishable from an empty one and would silently show nothing. The error carries the missing path so the user can check the right location.","triggerScenarios":"Running a lane-log command whose `LaneRegistry::load(&lane_id)` returns a lane whose `log_path` does not exist on disk at invocation time (`!path.exists()`).","commonSituations":"The lane was registered but never run, the log file was deleted or rotated away, the lane points at a path on another machine/container volume, or a typo in config points the lane at a stale path.","solutions":["Run the lane once so its log file is created, then retry the log command.","Verify the path shown in the error exists and matches the lane's configured log_path; fix the lane config if it points elsewhere.","If the log was rotated/deleted, restore it or re-register the lane to regenerate the log.","Check you are running on the same host/filesystem where the lane actually writes its log (containers, remote workers)."],"exampleFix":"// before: tail a lane that never started\ncodewhale lane log my-lane --tail 50\n// error: log file missing: /var/lib/codewhale/lanes/my-lane/log\n\n// after: start the lane first\ncodewhale lane run my-lane\ncodewhale lane log my-lane --tail 50","handlingStrategy":"try-catch","validationCode":"let path = lane.log_path;\nif !path.exists() {\n    eprintln!(\"skipping log tail: {} does not exist (lane never run?)\", path.display());\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"match run_lane_log(&lane_id) {\n    Err(e) if e.to_string().contains(\"log file missing\") => eprintln!(\"lane has no log yet; start it first\"),\n    Err(e) => return Err(e),\n    Ok(v) => println!(\"{v}\"),\n}","preventionTips":["Start/verify the lane before tailing its log.","Check the lane's log_path exists in health checks before invoking log commands.","Account for log rotation and cleanup jobs in scripts."],"tags":["filesystem","cli","logging","lane"],"backgroundTag":"file-not-found","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}