{"record":{"id":"772c3a8a24be21ec","repo":"cube-js/cube","slug":"branch-branch-is-not-building-verdict","errorCode":null,"errorMessage":"branch {branch} is not building ({verdict}){}. {}","messagePattern":"branch (.+?) is not building \\((.+?)\\)(.+?)\\. (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cube-cli/src/commands/deployments.rs","lineNumber":139,"sourceCode":"            .find(|(verdict, _)| error.contains(verdict))\n        {\n            // Name the verdict, not just the text: matching reads raw while printing\n            // is truncated, so in the very case raw matching exists for — a verdict\n            // after a long prefix — the printed complaint need not contain it, and a\n            // message whose quoted cause doesn't support its own advice is what makes\n            // someone doubt the tool. The fuller text is appended only when it says\n            // something the verdict doesn't, which today it usually doesn't.\n            //\n            // Exact equality, not `contains`, and that asymmetry with the match above\n            // is deliberate: a decorated verdict (\"Error: Bad branch\") therefore\n            // prints twice, which is untidy, while `contains` would swallow a\n            // decoration that carries the detail (\"Bad branch: refs/heads/typo not\n            // found\" would print as the bare verdict). Between repeating a few words\n            // and dropping the one line that says WHICH ref was wrong, the repetition\n            // is the cheaper mistake. Neither shape is live: both known verdicts\n            // arrive bare.\n            let branch = named_branch(&res);\n            anyhow::bail!(\n                \"branch {branch} is not building ({verdict}){}. {}\",\n                if complaint == *verdict {\n                    String::new()\n                } else {\n                    format!(\": {complaint}\")\n                },\n                hint(deployment, &branch)\n            );\n        }\n\n        if status == \"none\" || status == \"stopped\" {\n            let since = idle_since.get().unwrap_or_else(std::time::Instant::now);\n            idle_since.set(Some(since));\n            if since.elapsed() > IDLE_GRACE {\n                let branch = named_branch(&res);\n                anyhow::bail!(\n                    \"nothing is building branch {branch} (status {status}{}). If the branch \\\n                     exists, it only compiles once it is opened in dev mode — run {} and \\","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cube-cli/src/commands/deployments.rs#L121-L157","documentation":"Raised by wait_for_build while `cube deployments build/status --wait` polls a branch's build: the observed build verdict says the branch is NOT building (e.g. a known terminal verdict like a missing git ref). The message names the branch, the verdict, and the workflow's complaint (deduplicated when the complaint equals the verdict) so the user can see which ref or revision failed.","triggerScenarios":"`cube deployments ... --branch <branch> --wait` where the polled build resource reports a non-building verdict, typically \"Bad branch: refs/heads/<name> not found\" from the orchestrator after a branch typo or an unpushed local branch.","commonSituations":"Building a branch that was never pushed to origin; a renamed/deleted branch; specifying a tag or short ref where the backend expects a full branch name; CI building a branch from a merge that was already closed.","solutions":["Read the complaint in the message and verify the branch name — the commonest cause is a typo or an unpushed branch.","Push the branch to the remote: `git push -u origin <branch>` and re-run.","Use the exact branch name (no shorthand SHA or tag) as the orchestrator resolves refs/heads/<name>.","If the branch was deleted or merged, target the replacement branch."],"exampleFix":"// before: local-only branch\ncube deployments build 42 --branch fix/metrics --wait   # refs/heads/fix/metrics not found\n// after\ngit push -u origin fix/metrics\ncube deployments build 42 --branch fix/metrics --wait","handlingStrategy":"validation","validationCode":"# Ensure the branch exists on the remote before waiting on its build\ngit fetch origin \"$BRANCH\" || { echo \"branch $BRANCH not on origin\"; exit 1; }","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"is not building\") => {\n        // parse the verdict/complaint from the message; abort if it's a bad-ref error\n    }\n    other => other?,\n}","preventionTips":["Push the branch to origin before requesting a build.","Use full branch names (refs/heads semantics), never SHAs or tags.","Validate branch names against `git ls-remote --heads origin` in CI.","Remove stale branches from deploy configs after rename/delete."],"tags":["cli","git-branch","build-failed","ref-not-found","polling"],"backgroundTag":"git-ref-not-found","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}