zed-industries/zed · error

no such path

Error message

no such path

What it means

Raised when opening a buffer from an absolute path: the worktree-resolution task failed because no open worktree contains the absolute path ('no such path'). The file lies outside every registered project worktree.

Source

Thrown at crates/project/src/project.rs:3200

        abs_path: impl AsRef<Path>,
        cx: &mut Context<Self>,
    ) -> Task<Result<Entity<Buffer>>> {
        let worktree_task = self.find_or_create_worktree(abs_path.as_ref(), false, cx);
        cx.spawn(async move |this, cx| {
            let (worktree, relative_path) = worktree_task.await?;
            this.update(cx, |this, cx| {
                this.open_buffer((worktree.read(cx).id(), relative_path), cx)
            })?
            .await
        })
    }

    #[cfg(feature = "test-support")]
    pub fn open_local_buffer_with_lsp(
        &mut self,
        abs_path: impl AsRef<Path>,
        cx: &mut Context<Self>,
    ) -> Task<Result<(Entity<Buffer>, lsp_store::OpenLspBufferHandle)>> {
        if let Some((worktree, relative_path)) = self.find_worktree(abs_path.as_ref(), cx) {
            self.open_buffer_with_lsp((worktree.read(cx).id(), relative_path), cx)
        } else {
            Task::ready(Err(anyhow!("no such path")))
        }
    }

    pub fn download_file(
        &mut self,
        worktree_id: WorktreeId,
        path: Arc<RelPath>,
        destination_path: PathBuf,
        cx: &mut Context<Self>,
    ) -> Task<Result<()>> {
        log::debug!(
            "download_file called: worktree_id={:?}, path={:?}, destination={:?}",
            worktree_id,
            path,

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Verify the file path exists in an open worktree
  2. Add the parent directory as a worktree
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/project/src/project.rs:3187 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/f57af6ea13cd17b9. Report an issue: GitHub.