{"record":{"id":"576b49864aec54f3","repo":"zed-industries/zed","slug":"created-backup-tempdir","errorCode":null,"errorMessage":"created backup tempdir","messagePattern":"created backup tempdir","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/keymap_editor/src/keymap_editor.rs","lineNumber":3424,"sourceCode":"        cx: &mut AsyncApp,\n    ) -> anyhow::Result<(Entity<language::Buffer>, Option<tempfile::TempDir>)> {\n        let (temp_file_path, temp_dir) = {\n            let file_name = file_name.clone();\n            async move {\n                let temp_dir_backup = match temp_dir.as_ref() {\n                    Some(_) => None,\n                    None => {\n                        let temp_dir = paths::temp_dir();\n                        let sub_temp_dir = tempfile::Builder::new()\n                            .tempdir_in(temp_dir)\n                            .context(\"Failed to create temporary directory\")?;\n                        Some(sub_temp_dir)\n                    }\n                };\n                let dir_path = temp_dir.as_deref().unwrap_or_else(|| {\n                    temp_dir_backup\n                        .as_ref()\n                        .expect(\"created backup tempdir\")\n                        .path()\n                });\n                let path = dir_path.join(file_name);\n                fs.create_file(\n                    &path,\n                    fs::CreateOptions {\n                        ignore_if_exists: true,\n                        overwrite: true,\n                    },\n                )\n                .await\n                .context(\"Failed to create temporary file\")?;\n                anyhow::Ok((path, temp_dir_backup))\n            }\n        }\n        .await\n        .context(\"Failed to create backing file\")?;\n","sourceCodeStart":3406,"sourceCodeEnd":3442,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/keymap_editor/src/keymap_editor.rs#L3406-L3442","documentation":"Context-annotated error (not a panic) reported when opening a keymap-editor buffer: creating a backup of the edited file requires a tempfile::Builder tempdir under paths::temp_dir(), and that tempdir_in call failed. Common causes: no space in the temp directory, TMPDIR pointing to a nonexistent/unwritable path, or permission restrictions.","triggerScenarios":"Thrown at crates/keymap_editor/src/keymap_editor.rs:3420 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the temp directory (paths::temp_dir()) exists, is writable, and has free space","Set TMPDIR to a writable location and retry the keymap edit","Surface the io::Error source (already attached via context) to distinguish permissions from ENOSPC"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}