{"record":{"id":"ae31b5b6b014d669","repo":"nikivdev/code","slug":"failure-not-found-run-f-failure-list-to-in","errorCode":null,"errorMessage":"Failure '{}' not found. Run `f failure list` to inspect recent ids.","messagePattern":"Failure '(.+?)' not found\\. Run `f failure list` to inspect recent ids\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/failure.rs","lineNumber":355,"sourceCode":"    };\n\n    let path_candidate = PathBuf::from(id);\n    if (path_candidate.is_absolute() || id.contains(std::path::MAIN_SEPARATOR))\n        && path_candidate.exists()\n    {\n        return load_entry_from_path(&path_candidate);\n    }\n\n    let limit = 200;\n    recent_entries(limit)?\n        .into_iter()\n        .find(|entry| {\n            entry.id == id\n                || entry.path.file_name().and_then(|name| name.to_str()) == Some(id)\n                || entry.path.display().to_string() == id\n        })\n        .ok_or_else(|| {\n            anyhow::anyhow!(\n                \"Failure '{}' not found. Run `f failure list` to inspect recent ids.\",\n                id\n            )\n        })\n}\n\nfn load_entry_from_path(path: &Path) -> Result<FailureEntry> {\n    let content =\n        fs::read_to_string(path).with_context(|| format!(\"failed to read {}\", path.display()))?;\n    let record: FailureRecord = serde_json::from_str(&content)\n        .with_context(|| format!(\"failed to parse {}\", path.display()))?;\n    Ok(FailureEntry {\n        id: path\n            .file_stem()\n            .and_then(|stem| stem.to_str())\n            .unwrap_or(\"failure\")\n            .to_string(),\n        path: path.to_path_buf(),","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/failure.rs#L337-L373","documentation":"resolve_entry looks up a recorded failure entry by id, file name, or full path among stored failure entries; when no entry matches the given id it throws this anyhow error. It is thrown because run_copy was given a failure identifier that does not exist in the failure store.","triggerScenarios":"Calling `f copy` (run_copy) with an id argument that matches no entry's id, file name, or display path in the failure list.","commonSituations":"Typos in the id, using an id from an older session that was pruned, quoting/pasting errors, or referring to a failure by a name fragment rather than the exact file name or id.","solutions":["Run `f failure list` to see valid recent ids and copy the exact one","Retry using the entry's file name or full path instead of the id","Check that the failure store directory still exists and was not cleaned"],"exampleFix":"// before\nf copy abc123 outdir\n// after\nf failure list        # find exact id, e.g. f3a9c2\nf copy f3a9c2 outdir","handlingStrategy":"validation","validationCode":"let ids: Vec<String> = failure_list_ids();\nif !ids.iter().any(|i| i == requested_id) {\n    eprintln!(\"unknown failure id {}; valid: {:?}\", requested_id, ids);\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"match f_failure_copy(id, out) {\n    Err(e) if e.to_string().contains(\"not found\") => eprintln!(\"run `f failure list` first\"),\n    other => other?,\n}","preventionTips":["Copy ids directly from `f failure list` output","Script against ids programmatically by parsing failure list","Verify the id exists before passing it to copy"],"tags":["cli","lookup","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}