zed-industries/zed · error

Unable to deserialize editor: No entry in database for item_

Error message

Unable to deserialize editor: No entry in database for item_id: {item_id} and workspace_id {workspace_id:?}

What it means

Session restore tried to deserialize a saved editor but the database has no row for the given item_id in the given workspace_id. The serialized-editor lookup (guarded by 'Failed to query editor state') succeeded structurally but the JOIN/lookup on the items table found no entry, meaning the persisted editor row was deleted or the session references a stale item.

Source

Thrown at crates/editor/src/items.rs:1303

        item_id: ItemId,
        window: &mut Window,
        cx: &mut App,
    ) -> Task<Result<Entity<Self>>> {
        let serialized_editor = match EditorDb::global(cx)
            .get_serialized_editor(item_id, workspace_id)
            .context("Failed to query editor state")
        {
            Ok(Some(serialized_editor)) => {
                if ProjectSettings::get_global(cx)
                    .session
                    .restore_unsaved_buffers
                {
                    serialized_editor
                } else {
                    SerializedEditor {
                        abs_path: serialized_editor.abs_path,
                        contents: None,
                        language: None,
                        mtime: None,
                    }
                }
            }
            Ok(None) => {
                return Task::ready(Err(anyhow!(
                    "Unable to deserialize editor: No entry in database for item_id: {item_id} and workspace_id {workspace_id:?}"
                )));
            }
            Err(error) => {
                return Task::ready(Err(error));
            }
        };
        log::debug!(
            "Deserialized editor {item_id:?} in workspace {workspace_id:?}, {serialized_editor:?}"
        );

        match serialized_editor {

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Skip restoring this editor and continue the session restore for remaining items
  2. Run the session cleanup routine that prunes orphaned editor-state rows referencing missing items
  3. Treat as non-fatal: log it, since a missing saved buffer is recoverable by simply not reopening that editor
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/editor/src/items.rs:1295 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/5e555ced94d664e7. Report an issue: GitHub.