zed-industries/zed · error

not a remote project

Error message

not a remote project

What it means

In Project::download_file: self.remote_client is None, i.e. the project is local (or not connected to a remote server), but a file download was requested — an operation only valid for remote projects. The error is also logged.

Source

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

            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,
            destination_path
        );

        let Some(remote_client) = &self.remote_client else {
            log::error!("download_file: not a remote project");
            return Task::ready(Err(anyhow!("not a remote project")));
        };

        let proto_client = remote_client.read(cx).proto_client();
        // For SSH remote projects, use REMOTE_SERVER_PROJECT_ID instead of remote_id()
        // because SSH projects have client_state: Local but still need to communicate with remote server
        let project_id = self.remote_id().unwrap_or(REMOTE_SERVER_PROJECT_ID);
        let downloading_files = self.downloading_files.clone();
        let path_str = path.as_unix_str().to_owned();

        static NEXT_FILE_ID: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1);
        let file_id = NEXT_FILE_ID.fetch_add(1, std::sync::atomic::Ordering::SeqCst);

        // Register BEFORE sending request to avoid race condition
        let key = (worktree_id, path_str.clone());

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Only call download_file on remote projects
  2. Open the file directly from the local filesystem instead
Defensive patterns

Strategy: validation

When it happens

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