zed-industries/zed · error

created backup tempdir

Error message

created backup tempdir

What it means

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.

Source

Thrown at crates/keymap_editor/src/keymap_editor.rs:3424

        cx: &mut AsyncApp,
    ) -> anyhow::Result<(Entity<language::Buffer>, Option<tempfile::TempDir>)> {
        let (temp_file_path, temp_dir) = {
            let file_name = file_name.clone();
            async move {
                let temp_dir_backup = match temp_dir.as_ref() {
                    Some(_) => None,
                    None => {
                        let temp_dir = paths::temp_dir();
                        let sub_temp_dir = tempfile::Builder::new()
                            .tempdir_in(temp_dir)
                            .context("Failed to create temporary directory")?;
                        Some(sub_temp_dir)
                    }
                };
                let dir_path = temp_dir.as_deref().unwrap_or_else(|| {
                    temp_dir_backup
                        .as_ref()
                        .expect("created backup tempdir")
                        .path()
                });
                let path = dir_path.join(file_name);
                fs.create_file(
                    &path,
                    fs::CreateOptions {
                        ignore_if_exists: true,
                        overwrite: true,
                    },
                )
                .await
                .context("Failed to create temporary file")?;
                anyhow::Ok((path, temp_dir_backup))
            }
        }
        .await
        .context("Failed to create backing file")?;

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Check that the temp directory (paths::temp_dir()) exists, is writable, and has free space
  2. Set TMPDIR to a writable location and retry the keymap edit
  3. Surface the io::Error source (already attached via context) to distinguish permissions from ENOSPC
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/keymap_editor/src/keymap_editor.rs:3420 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/576b49864aec54f3. Report an issue: GitHub.