{"record":{"id":"509190cd560bd612","repo":"zed-industries/zed","slug":"no-worktree-for-id-worktree-id","errorCode":null,"errorMessage":"No worktree for id {worktree_id:?}","messagePattern":"No worktree for id (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project/src/project.rs","lineNumber":2761,"sourceCode":"        worktree.update(cx, |worktree, cx| worktree.trash_entry(entry_id, cx))\n    }\n\n    #[inline]\n    pub fn delete_entry(\n        &mut self,\n        entry_id: ProjectEntryId,\n        cx: &mut Context<Self>,\n    ) -> Option<Task<Result<()>>> {\n        let worktree = self.worktree_for_entry(entry_id, cx)?;\n        cx.emit(Event::DeletedEntry(worktree.read(cx).id(), entry_id));\n        worktree.update(cx, |worktree, cx| worktree.delete_entry(entry_id, cx))\n    }\n\n    #[inline]\n    pub fn restore_entry(\n        &self,\n        worktree_id: WorktreeId,\n        trash_id: TrashId,\n        cx: &mut Context<'_, Self>,\n    ) -> Task<Result<ProjectPath>> {\n        let Some(worktree) = self.worktree_for_id(worktree_id, cx) else {\n            return Task::ready(Err(anyhow!(\"No worktree for id {worktree_id:?}\")));\n        };\n\n        cx.spawn(async move |_, cx| {\n            let entry = worktree\n                .update(cx, |worktree, cx| worktree.restore_entry(trash_id, cx))\n                .await?;\n\n            Ok(ProjectPath {\n                worktree_id: worktree_id,\n                path: entry.path,\n            })\n        })\n    }\n","sourceCodeStart":2743,"sourceCodeEnd":2779,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/project/src/project.rs#L2743-L2779","documentation":"Returned by restore_entry when no worktree with the given WorktreeId exists in the project (it was removed or the restore refers to a stale id). The trash entry cannot be restored into a nonexistent worktree, so the task resolves with this error.","triggerScenarios":"Thrown at crates/project/src/project.rs:2748 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the originating worktree is still open in the workspace","Retry the restore once the worktree is loaded"],"exampleFix":null,"handlingStrategy":"type-guard","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-14T05:17:10.506Z"}