{"record":{"id":"8d82d68c76e423ae","repo":"nikivdev/code","slug":"no-running-process-found-for-task","errorCode":null,"errorMessage":"No running process found for task '{}'","messagePattern":"No running process found for task '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/processes.rs","lineNumber":140,"sourceCode":"    // Find the process entry to get its PGID\n    let entry = processes.projects.values().flatten().find(|p| p.pid == pid);\n\n    let pgid = entry.map(|e| e.pgid).unwrap_or(pid);\n    let task_name = entry.map(|e| e.task_name.as_str()).unwrap_or(\"unknown\");\n\n    terminate_process_group(pgid, force, timeout)?;\n    running::unregister_process(pid)?;\n\n    println!(\"Killed {} (pid: {}, pgid: {})\", task_name, pid, pgid);\n    Ok(())\n}\n\nfn kill_by_task(config_path: &Path, task: &str, force: bool, timeout: u64) -> Result<()> {\n    let processes = running::get_project_processes(config_path)?;\n    let matching: Vec<_> = processes.iter().filter(|p| p.task_name == task).collect();\n\n    if matching.is_empty() {\n        bail!(\"No running process found for task '{}'\", task);\n    }\n\n    for proc in matching {\n        terminate_process_group(proc.pgid, force, timeout)?;\n        running::unregister_process(proc.pid)?;\n        println!(\"Killed {} (pid: {})\", proc.task_name, proc.pid);\n    }\n\n    Ok(())\n}\n\nfn kill_all_for_project(config_path: &Path, force: bool, timeout: u64) -> Result<()> {\n    let processes = running::get_project_processes(config_path)?;\n\n    if processes.is_empty() {\n        println!(\"No running processes to kill.\");\n        return Ok(());\n    }","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/processes.rs#L122-L158","documentation":"kill_by_task looks up the project's registered running processes and filters by task name; if no registered process matches the given task, it bails. This means the task exists in config perhaps but is not currently running (or its registration was lost).","triggerScenarios":"Calling `f kill <task>` (or kill_by_task) where running::get_project_processes returns no entry whose task_name equals the argument — task never started, already exited, or was killed previously.","commonSituations":"Typo in the task name vs flow.toml, task already finished or crashed and was unregistered, running `f kill` from a different project root so the running-process registry belongs to another project.","solutions":["Run `f ps` (or list running processes) to see which task names are actually running.","Fix the task-name spelling to match the running task exactly.","If the task should be running, start it first (e.g. `f run <task>`), then kill it.","Verify you are in the correct project root (flow.toml) so the right process registry is consulted."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify the task is running before killing\nlet running = list_running_processes()?;\nif !running.iter().any(|p| p.task_name == task) {\n    eprintln!(\"task '{task}' is not running; nothing to kill\");\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = kill_processes(opts) {\n    let msg = e.to_string();\n    if msg.contains(\"No running process found\") {\n        eprintln!(\"{msg} — check `f ps` for exact task names\");\n    } else { return Err(e); }\n}","preventionTips":["List running tasks (`f ps`) before killing.","Match task names exactly as defined in flow.toml.","Run kill from the same project root the task was started in.","Make kill idempotent in scripts: ignore 'no running process' errors."],"tags":["processes","not-found","cli"],"backgroundTag":"process-not-running","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}