BloopAI/vibe-kanban · error
Workspace not found
Error message
Workspace not found
What it means
When a workspace operation targets a workspace id that doesn't exist in the workspace manager's store, WorkspaceError::WorkspaceNotFound is mapped to ContainerError::Other with 'Workspace not found'. It means the referenced workspace was never created or has since been deleted.
Source
Thrown at crates/local-deployment/src/container.rs:146
};
container.spawn_workspace_cleanup();
container
}
fn map_workspace_manager_error(err: WorkspaceError) -> ContainerError {
match err {
WorkspaceError::Database(err) => ContainerError::Sqlx(err),
WorkspaceError::Worktree(err) => ContainerError::Worktree(err),
WorkspaceError::GitService(err) => ContainerError::GitServiceError(err),
WorkspaceError::Io(err) => ContainerError::Io(err),
WorkspaceError::NoRepositories => {
ContainerError::Other(anyhow!("No repositories provided"))
}
WorkspaceError::Repo(err) => ContainerError::Other(anyhow!(err)),
WorkspaceError::WorkspaceNotFound => {
ContainerError::Other(anyhow!("Workspace not found"))
}
WorkspaceError::RepoAlreadyAttached => {
ContainerError::Other(anyhow!("Repository already attached to workspace"))
}
WorkspaceError::BranchNotFound { repo_name, branch } => ContainerError::Other(anyhow!(
"Branch '{}' does not exist in repository '{}'",
branch,
repo_name
)),
WorkspaceError::PartialCreation(msg) => ContainerError::Other(anyhow!(msg)),
}
}
async fn workspace_repo_inputs(
&self,
workspace_id: Uuid,
) -> Result<(Vec<Repo>, Vec<RepoWorkspaceInput>), ContainerError> {
let workspace_repos =View on GitHub (pinned to 4deb7eca8f)
Solutions
- Verify the workspace id exists (list workspaces) before operating on it.
- Refresh the client's workspace list and retry with a valid id.
- If the DB was reset, recreate the workspace.
- Handle the not-found case gracefully in the UI (navigate away/offer re-creation) instead of surfacing a raw error.
Example fix
// before
container.start_workspace(&stale_id).await?;
// after
match container.start_workspace(&id).await {
Ok(()) => {},
Err(e) if e.to_string().contains("Workspace not found") => refresh_and_prompt_recreate(),
Err(e) => return Err(e.into()),
} Defensive patterns
Strategy: try-catch
Validate before calling
// check existence before operating
let exists = workspace_store.get(&workspace_id).await.is_some();
if !exists {
return Err(anyhow!("workspace {workspace_id} no longer exists"));
} Try / catch
match container.start_workspace(&id).await {
Err(e) if e.to_string().contains("Workspace not found") => {
refresh_workspace_list(); // drop stale id, re-create or navigate away
}
Err(e) => return Err(e.into()),
Ok(v) => v,
} Prevention
- Refresh workspace lists after deletes/mutations to avoid stale ids.
- Never hardcode workspace ids in scripts; resolve by name at runtime.
- Check whether DB resets/migrations removed workspace rows.
- Subscribe to workspace-deleted events if the client framework offers them.
When it happens
Trigger: Calling container APIs (start/stop/pause/delete, etc.) with a workspace id absent from the database — deleted workspace, wrong id, or a row removed by another client while cached locally.
Common situations: UI keeps a stale workspace open after deletion in another window, scripts hardcode ids from a previous environment, or DB was reset/migrated losing the workspace rows.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Invitation not found (${res.status})
- result.error
- No setup script configured for this project
- Cannot run script while another process is running
- Failed to run setup script
AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29).
Data as JSON: /api/errors/fedf86d2c7315ab9.
Report an issue: GitHub.