zed-industries/zed · error

no such project

Error message

no such project

What it means

Thrown by rejoin_room when one of the reshared_projects entries resolves to a project whose host_user_id is not the rejoining user. The project row is fetched with context 'project does not exist' and then ownership is checked; failing ownership returns the deliberately generic 'no such project' so the server does not leak the existence of other users' projects.

Source

Thrown at crates/collab/src/db/queries/rooms.rs:510

                    ))),
                    answering_connection_lost: ActiveValue::set(false),
                    ..Default::default()
                })
                .exec(&*tx)
                .await?;
            if participant_update.rows_affected == 0 {
                return Err(anyhow!("room does not exist or was already joined"))?;
            }

            let mut reshared_projects = Vec::new();
            for reshared_project in &rejoin_room.reshared_projects {
                let project_id = ProjectId::from_proto(reshared_project.project_id);
                let project = project::Entity::find_by_id(project_id)
                    .one(&*tx)
                    .await?
                    .context("project does not exist")?;
                if project.host_user_id != Some(user_id) {
                    return Err(anyhow!("no such project"))?;
                }

                let mut collaborators = project
                    .find_related(project_collaborator::Entity)
                    .all(&*tx)
                    .await?;
                let host_ix = collaborators
                    .iter()
                    .position(|collaborator| {
                        collaborator.user_id == user_id && collaborator.is_host
                    })
                    .context("host not found among collaborators")?;
                let host = collaborators.swap_remove(host_ix);
                let old_connection_id = host.connection();

                project::Entity::update(project::ActiveModel {
                    host_connection_id: ActiveValue::set(Some(connection.id as i32)),
                    host_connection_server_id: ActiveValue::set(Some(ServerId(

View on GitHub (pinned to bc538def45)

Solutions

  1. Filter reshared_projects down to projects the client still believes it hosts before sending RejoinRoom
  2. On this error, drop the offending project from the rejoin set and retry the rejoin
  3. Re-share the project (create a fresh share) instead of reusing the stale project id

Example fix

// before
request.reshared_projects = cached_shared_project_ids(room_id);
client.rejoin_room(request).await?;

// after (only rejoin projects this client hosts)
request.reshared_projects = cached_shared_project_ids(room_id)
    .into_iter()
    .filter(|id| self.hosted_projects.contains(id))
    .collect();
client.rejoin_room(request).await?;
Defensive patterns

Strategy: validation

Validate before calling

// Only reshare projects this client currently hosts.
request.reshared_projects = cached_shared_project_ids(room_id)
    .into_iter()
    .filter(|id| self.hosted_projects.contains(id))
    .map(|id| ResharedProject { project_id: id, ..Default::default() })
    .collect();
client.rejoin_room(request).await?;

Try / catch

match client.rejoin_room(request).await {
    Ok(rejoin) => Ok(rejoin),
    Err(err) if err.to_string().contains("no such project") => {
        request.reshared_projects.clear();
        client.rejoin_room(request).await // retry without stale shares
    }
    Err(err) => Err(err),
}

Prevention

When it happens

Trigger: Rejoining with a cached project id that was later unshared, deleted, or whose hosting moved to another user; rejoining with a project id belonging to someone else's share; host migration between the disconnect and the rejoin.

Common situations: Stale client cache of shared project ids across reconnects; user signed out and back in as a different account but kept the room state; project shared by another host after the original host left.

Related errors


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