zed-industries/zed · error

cannot open repository on disconnected remote machine

Error message

cannot open repository on disconnected remote machine

What it means

When restoring (unarchiving) a thread worktree whose project lives on a remote machine, Zed builds a temporary remote project by reusing the SSH connection from the pool. remote::has_active_connection now reports the connection is gone, so no temporary remote project can be created and the restore aborts.

Source

Thrown at crates/agent_ui/src/thread_worktree_archive.rs:410

            .next()
    });

    if let Some((repo, project)) = live_repo {
        return Ok((repo, project));
    }

    let app_state =
        current_app_state(cx).context("no app state available for temporary project")?;

    // For remote paths, create a fresh RemoteClient through the connection
    // pool (reusing the existing SSH transport) and build a temporary
    // remote project. Each RemoteClient gets its own server-side headless
    // project, so there are no RPC routing conflicts with other projects.
    let temp_project = if let Some(connection) = remote_connection_owned {
        let remote_client = cx
            .update(|cx| {
                if !remote::has_active_connection(&connection, cx) {
                    anyhow::bail!("cannot open repository on disconnected remote machine");
                }
                Ok(remote_connection::connect_reusing_pool(connection, cx))
            })?
            .await?
            .context("remote connection was canceled")?;

        cx.update(|cx| {
            Project::remote(
                remote_client,
                app_state.client.clone(),
                app_state.node_runtime.clone(),
                app_state.user_store.clone(),
                app_state.languages.clone(),
                app_state.fs.clone(),
                false,
                cx,
            )
        })

View on GitHub (pinned to bc538def45)

Solutions

  1. Reconnect to the remote machine (reopen the remote project) and retry the restore.
  2. Verify SSH reachability and credentials/agent forwarding to that host.
  3. If the remote is gone for good, restore against a local clone of the repository or remove the archive.
Defensive patterns

Strategy: validation

Validate before calling

if let Some(connection) = &remote_connection {
    if !remote::has_active_connection(connection, cx) {
        // prompt the user to reconnect to the remote before restoring
    }
}

Prevention

When it happens

Trigger: Restoring an archived thread while the SSH remote has disconnected: network change, laptop sleep, remote server restart, or Zed restarted without re-establishing the connection.

Common situations: Resuming work after connectivity loss; remote dev box rebooted; a stale archive referencing a remote project that is no longer reachable.

Related errors


AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16). Data as JSON: /api/errors/bb6867347af204b7. Report an issue: GitHub.