{"record":{"id":"56666dcc45f08ac7","repo":"zed-industries/zed","slug":"failed-to-open-failed-jsonl","errorCode":null,"errorMessage":"Failed to open failed.jsonl","messagePattern":"Failed to open failed\\.jsonl","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/main.rs","lineNumber":1662,"sourceCode":"            .write(\n                &failed_example_path,\n                &serde_json::to_vec_pretty(&example).unwrap(),\n            )\n            .await\n            .unwrap();\n        let err_path = FAILED_EXAMPLES_DIR.join(format!(\"{}_err.txt\", example_name));\n        app_state\n            .fs\n            .write(&err_path, format!(\"{error:?}\").as_bytes())\n            .await\n            .unwrap();\n\n        let failed_jsonl_path = RUN_DIR.join(\"failed.jsonl\");\n        let mut file = OpenOptions::new()\n            .create(true)\n            .append(true)\n            .open(&failed_jsonl_path)\n            .expect(\"Failed to open failed.jsonl\");\n        writeln!(file, \"{}\", serde_json::to_string(example).unwrap())\n            .expect(\"Failed to write to failed.jsonl\");\n\n        let cursor_path = match example.repo_name() {\n            Ok(repo_name) => repo_name.worktree_path().join(&example.spec.cursor_path),\n            Err(_) => example.spec.cursor_path.as_ref().to_path_buf(),\n        };\n        msg = format!(\n            indoc::indoc! {\"\n                While processing \\\"{}\\\":\n\n                \\x1b[31m{:?}\\x1b[0m\n\n                Example:        \\x1b[36m{}\\x1b[0m\n                Error file:     \\x1b[36m{}\\x1b[0m\n                Cursor file:    \\x1b[36m{}\\x1b[0m\n                Re-run:         cargo run -p edit_prediction_cli -- {} \\x1b[36m{}\\x1b[0m\n            \"},","sourceCodeStart":1644,"sourceCodeEnd":1680,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/main.rs#L1644-L1680","documentation":"A panic in the edit-prediction CLI's failure-recording path: opening failed.jsonl in the run directory for append fails (missing RUN_DIR, permissions). The record of the failed example cannot be persisted, so the CLI aborts.","triggerScenarios":"Thrown at crates/edit_prediction_cli/src/main.rs:1662 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify RUN_DIR exists and is writable (it is created at run start)","Check disk space and permissions in the run directory","Re-create the run directory if it was deleted mid-run"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}