nikivdev/code · error
No log file found for task '{}' at {}
Error message
No log file found for task '{}' at {} What it means
After resolving the project and task, show_task_logs computes the task's log file path and bails if that file does not exist. This means no log was ever written for the task at that location — the task never ran, was run under a different project name, or logs were cleaned.
Source
Thrown at src/processes.rs:379
return Ok(());
} else if logs.len() == 1 {
// No running tasks, but only one log file
logs[0].clone()
} else {
// No running tasks, multiple log files
println!("No running tasks. Available logs:");
for log in &logs {
println!(" f logs {}", log);
}
return Ok(());
}
}
};
let log_path = get_log_path(&project_root, project_name.as_deref(), &task_name);
if !log_path.exists() {
bail!(
"No log file found for task '{}' at {}",
task_name,
log_path.display()
);
}
if opts.follow {
tail_follow(&log_path, opts.lines, opts.quiet)?;
} else {
tail_lines(&log_path, opts.lines)?;
}
Ok(())
}
fn show_all_logs(lines: usize) -> Result<()> {
let base = log_dir();
if !base.exists() {View on GitHub (pinned to a747e741ae)
Solutions
- Run the task first (`f run <task>`) so a log file is created, then view logs.
- Verify the task name spelling matches what was actually run.
- Check the log directory shown in the message manually (ls) to see which task logs exist.
- If logs were deleted or the project was renamed, re-run tasks to regenerate logs under the current project name.
Defensive patterns
Strategy: validation
Validate before calling
// check a log exists before asking to view it
let logs = std::fs::read_dir(log_dir)?;
let found = logs.filter_map(Result::ok)
.any(|e| e.file_name().to_string_lossy().contains(task));
if !found {
eprintln!("no log for '{task}' yet; run `f run {task}` first");
return Ok(());
} Try / catch
match show_task_logs(opts) {
Ok(()) => (),
Err(e) if e.to_string().contains("No log file found") => {
eprintln!("{e} — run the task first");
std::process::exit(1);
}
Err(e) => return Err(e),
} Prevention
- Run the task before requesting its logs.
- Do not delete the project's logs directory manually.
- Use the same project name (-p) that was active when the task ran.
- Confirm task name spelling against flow.toml.
When it happens
Trigger: `f logs <task>` where get_log_path(project_root, project_name, task).exists() is false — task never started, wrong task name, logs directory cleared, or project_name changed so the path differs from where logs were written.
Common situations: Asking for logs of a configured-but-never-run task, after manually deleting the logs directory, running with -p under a different project name than when the task ran, or a task whose run failed before log file creation.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- Could not find agent file for '{}'
- Diff bundle not found. Expected {} or pass a path to a bundl
- Template not found: {}
- Source folder does not exist: {}
- Doc file not found: {}.md
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/4f9d4790892291c4.
Report an issue: GitHub.