cube-js/cube · error
branch {branch} is not building ({verdict}){}. {}
Error message
branch {branch} is not building ({verdict}){}. {} What it means
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.
Source
Thrown at rust/cube-cli/src/commands/deployments.rs:139
.find(|(verdict, _)| error.contains(verdict))
{
// Name the verdict, not just the text: matching reads raw while printing
// is truncated, so in the very case raw matching exists for — a verdict
// after a long prefix — the printed complaint need not contain it, and a
// message whose quoted cause doesn't support its own advice is what makes
// someone doubt the tool. The fuller text is appended only when it says
// something the verdict doesn't, which today it usually doesn't.
//
// Exact equality, not `contains`, and that asymmetry with the match above
// is deliberate: a decorated verdict ("Error: Bad branch") therefore
// prints twice, which is untidy, while `contains` would swallow a
// decoration that carries the detail ("Bad branch: refs/heads/typo not
// found" would print as the bare verdict). Between repeating a few words
// and dropping the one line that says WHICH ref was wrong, the repetition
// is the cheaper mistake. Neither shape is live: both known verdicts
// arrive bare.
let branch = named_branch(&res);
anyhow::bail!(
"branch {branch} is not building ({verdict}){}. {}",
if complaint == *verdict {
String::new()
} else {
format!(": {complaint}")
},
hint(deployment, &branch)
);
}
if status == "none" || status == "stopped" {
let since = idle_since.get().unwrap_or_else(std::time::Instant::now);
idle_since.set(Some(since));
if since.elapsed() > IDLE_GRACE {
let branch = named_branch(&res);
anyhow::bail!(
"nothing is building branch {branch} (status {status}{}). If the branch \
exists, it only compiles once it is opened in dev mode — run {} and \View on GitHub (pinned to 7d981676b3)
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.
Example fix
// before: local-only branch cube deployments build 42 --branch fix/metrics --wait # refs/heads/fix/metrics not found // after git push -u origin fix/metrics cube deployments build 42 --branch fix/metrics --wait
Defensive patterns
Strategy: validation
Validate before calling
# Ensure the branch exists on the remote before waiting on its build
git fetch origin "$BRANCH" || { echo "branch $BRANCH not on origin"; exit 1; } Try / catch
match result {
Err(e) if e.to_string().contains("is not building") => {
// parse the verdict/complaint from the message; abort if it's a bad-ref error
}
other => other?,
} Prevention
- 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.
When it happens
Trigger: `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.
Common situations: 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.
Related errors
- no dbt sync {sync_job_id} on deployment {deployment}. It may
- no result for dbt sync {sync_job_id} yet — check `cube dbt s
- nothing is building branch {branch} (status {status}{}). If
- ${pkg} dependency not found. Please run this command from pr
- BigQuery job timeout reached ${this.options.pollTimeout}ms
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/772c3a8a24be21ec.
Report an issue: GitHub.