BloopAI/vibe-kanban · error
Workspace has no repositories configured
Error message
Workspace has no repositories configured
What it means
workspace_repo_inputs loads the workspace's repo mappings and aborts with this error if WorkspaceRepo::find_by_workspace_id returns an empty list. A workspace in this system is defined by its repositories, so any operation that needs repo inputs (create, ensure_container_exists) cannot proceed without at least one. It is a data-consistency guard against workspaces with no configured repos.
Source
Thrown at crates/local-deployment/src/container.rs:167
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 =
WorkspaceRepo::find_by_workspace_id(&self.db.pool, workspace_id).await?;
if workspace_repos.is_empty() {
return Err(ContainerError::Other(anyhow!(
"Workspace has no repositories configured"
)));
}
let repositories =
WorkspaceRepo::find_repos_for_workspace(&self.db.pool, workspace_id).await?;
let target_branches: HashMap<_, _> = workspace_repos
.iter()
.map(|wr| (wr.repo_id, wr.target_branch.clone()))
.collect();
let workspace_inputs: Vec<RepoWorkspaceInput> = repositories
.iter()
.map(|repo| {
let target_branch = target_branches.get(&repo.id).cloned().ok_or_else(|| {
ContainerError::Other(anyhow!(
"Missing target branch mapping for repo {} in workspace {}",
repo.id,View on GitHub (pinned to 4deb7eca8f)
Solutions
- Ensure the create-workspace request includes at least one repository in its repos list.
- Verify in the DB that workspace_repos rows exist for the workspace_id (`SELECT * FROM workspace_repos WHERE workspace_id = ...`).
- Attach a repo to the workspace before retrying the operation.
- If the workspace is genuinely empty/legacy, delete it and create a new one with repos.
Example fix
// before
let ws = container.create(&CreateWorkspaceReq { repos: vec![], .. }).await?;
// after
if req.repos.is_empty() {
return Err(anyhow!("At least one repository is required"));
}
let ws = container.create(&req).await?; Defensive patterns
Strategy: validation
Validate before calling
let repos = WorkspaceRepo::find_by_workspace_id(&pool, ws_id).await?;
if repos.is_empty() {
return Err(anyhow!("workspace {ws_id} has no repos; attach one first"));
} Try / catch
match container.create(&req).await {
Err(ContainerError::Other(e)) if e.to_string().contains("no repositories configured") => {
// prompt user to add repos, don't retry blindly
Err(e)
}
other => other,
} Prevention
- Enforce at least one repo in create-workspace requests (client and server side).
- Block deletion of the last workspace repo mapping.
- Validate workspace state after PartialCreation cleanup.
- Confirm the workspace_id is the intended one before operating on it.
When it happens
Trigger: Calling create or ensure_container_exists for a workspace_id whose workspace_repos rows are absent — e.g. workspace row created but repos never attached, or repos were removed after creation.
Common situations: Creating a workspace request with an empty repos array; manually deleting workspace_repos rows in the DB; a failed PartialCreation cleanup leaving an empty workspace; passing a wrong/old workspace_id.
Related errors
- result.error
- No setup script configured for this project
- No cleanup script configured for this project
- No archive script configured for this project
- No repositories provided
AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29).
Data as JSON: /api/errors/af9f51537b742956.
Report an issue: GitHub.