{"record":{"id":"f54f5dcf78e58d99","repo":"BloopAI/vibe-kanban","slug":"branch-does-not-exist-in-repository","errorCode":null,"errorMessage":"Branch '{}' does not exist in repository '{}'","messagePattern":"Branch '(.+?)' does not exist in repository '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/local-deployment/src/container.rs","lineNumber":151,"sourceCode":"    }\n\n    fn map_workspace_manager_error(err: WorkspaceError) -> ContainerError {\n        match err {\n            WorkspaceError::Database(err) => ContainerError::Sqlx(err),\n            WorkspaceError::Worktree(err) => ContainerError::Worktree(err),\n            WorkspaceError::GitService(err) => ContainerError::GitServiceError(err),\n            WorkspaceError::Io(err) => ContainerError::Io(err),\n            WorkspaceError::NoRepositories => {\n                ContainerError::Other(anyhow!(\"No repositories provided\"))\n            }\n            WorkspaceError::Repo(err) => ContainerError::Other(anyhow!(err)),\n            WorkspaceError::WorkspaceNotFound => {\n                ContainerError::Other(anyhow!(\"Workspace not found\"))\n            }\n            WorkspaceError::RepoAlreadyAttached => {\n                ContainerError::Other(anyhow!(\"Repository already attached to workspace\"))\n            }\n            WorkspaceError::BranchNotFound { repo_name, branch } => ContainerError::Other(anyhow!(\n                \"Branch '{}' does not exist in repository '{}'\",\n                branch,\n                repo_name\n            )),\n            WorkspaceError::PartialCreation(msg) => ContainerError::Other(anyhow!(msg)),\n        }\n    }\n\n    async fn workspace_repo_inputs(\n        &self,\n        workspace_id: Uuid,\n    ) -> Result<(Vec<Repo>, Vec<RepoWorkspaceInput>), ContainerError> {\n        let workspace_repos =\n            WorkspaceRepo::find_by_workspace_id(&self.db.pool, workspace_id).await?;\n        if workspace_repos.is_empty() {\n            return Err(ContainerError::Other(anyhow!(\n                \"Workspace has no repositories configured\"\n            )));","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/local-deployment/src/container.rs#L133-L169","documentation":"map_workspace_manager_error converts WorkspaceError::BranchNotFound into this message, interpolating the requested branch and repository names. It is thrown when an operation needs a branch (e.g. creating a workspace worktree or starting an execution) and git lookup shows the branch does not exist in that repository. It is a git-level precondition failure surfaced as ContainerError::Other.","triggerScenarios":"Creating a workspace whose target_branch for a repo does not exist locally in that repo; starting an execution pinned to a branch that was never fetched or was deleted.","commonSituations":"Typo'd branch name in workspace/project config; branch exists only on the remote and was never fetched; branch was force-deleted or rebased away; stale config after a repo switch.","solutions":["Verify the branch exists: run `git branch --list <branch>` (or `git ls-remote origin <branch>`) in the repo.","Fetch the remote branch first (`git fetch origin <branch>:<branch>`) so it exists locally, then retry.","Correct the target_branch value in the workspace/project configuration to an existing branch.","Create the branch if intended: `git branch <branch> <base-ref>`."],"exampleFix":"// before\nlet input = RepoWorkspaceInput::new(repo, \"feature/fix\"); // branch never fetched\n// after\nrepo.git_fetch_branch(\"feature/fix\").await?; // ensure local branch exists\nlet input = RepoWorkspaceInput::new(repo, \"feature/fix\");","handlingStrategy":"validation","validationCode":"let ok = tokio::process::Command::new(\"git\")\n    .args([\"rev-parse\", \"--verify\", &format!(\"refs/heads/{branch}\")])\n    .current_dir(&repo.path)\n    .status().await?.success();\nif !ok { return Err(anyhow!(\"branch {branch} missing in {}\", repo.name)); }","typeGuard":null,"tryCatchPattern":"match container.create(&req).await {\n    Err(ContainerError::Other(e)) if e.to_string().contains(\"does not exist in repository\") => {\n        // parse branch/repo from message, fetch or fix config, retry once\n        Err(e)\n    }\n    other => other,\n}","preventionTips":["Validate branch names against `git branch --list` before creating workspaces.","Always `git fetch` remote branches before referencing them.","Keep branch config in sync when branches are deleted upstream.","Default to the repo's HEAD/default branch when unset."],"tags":["git","branch","workspace"],"backgroundTag":"git-branch-not-found","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}