{"record":{"id":"0e07503f884ef087","repo":"cube-js/cube","slug":"build-status-for-branch","errorCode":null,"errorMessage":"build {status} for branch {}{}","messagePattern":"build (.+?) for branch (.+?)(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cube-cli/src/commands/deployments.rs","lineNumber":515,"sourceCode":"                return Ok(());\n            }\n\n            let res = wait_for_build(&api, deployment, &path, &query, timeout, poll).await?;\n            output::print_json(&res);\n\n            let status = util::status_of(&res, \"status\");\n            if BUILD_FAILED.contains(&status.as_str()) {\n                // Normalised like the two sites in `wait_for_build`, and this is the one\n                // that needs it most: those quote a short worker verdict, while this is a\n                // FAILED BUILD, so the text is a compile error that can arrive long and\n                // multi-line. Nothing matches against it here — the status already said\n                // what happened — so the raw/normalised split those sites keep for\n                // `contains` doesn't apply.\n                // `REASON_LIMIT`, not `COMPLAINT_LIMIT`: the poll labels above are\n                // repeated and deduped, so they must stay short — this is printed once\n                // and is the whole point of the message.\n                let error = util::one_line(&output::field(&res, \"errorText\"), util::REASON_LIMIT);\n                anyhow::bail!(\n                    \"build {status} for branch {}{}\",\n                    named_branch(&res),\n                    // Still `is_blank` rather than `is_empty`, though `one_line` has\n                    // already collapsed blanks to nothing: one rule at every site that\n                    // picks an arm is cheaper to keep true than one with an exception\n                    // whose safety depends on a call two lines up.\n                    if util::is_blank(&error) {\n                        String::new()\n                    } else {\n                        format!(\": {error}\")\n                    }\n                );\n            }\n        }\n        Cmd::AdvanceStep { deployment, step } => {\n            let res = api\n                .post(\n                    &format!(\"/api/v1/deployments/{deployment}/creation-step/advance\"),","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cube-cli/src/commands/deployments.rs#L497-L533","documentation":"This error is raised by the CLI when polling a deployment build: the build reached a terminal failure status, and the API's errorText field is surfaced (condensed to one line) as the error message. It tells the developer which branch's build failed and why, according to the control plane.","triggerScenarios":"Running a command that waits for a deployment build to finish (e.g. `cube deployments create` or a redeploy targeting a branch) and the build ends in a failed/cancelled status.","commonSituations":"Broken data model committed to the branch; build infra failure; invalid creationStep configuration; transient API errors recorded as errorText by the build pipeline.","solutions":["Read the errorText portion of the message — it carries the build failure reason from the API","Fix the underlying issue in the branch's project/data model and redeploy","Re-run the build; if errorText is empty or unhelpful, check build logs in the Cube Cloud UI"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  runBuildAndWait(branch);\n} catch (e) {\n  const m = /build (\\S+) for branch (\\S+)/.exec(String(e));\n  if (m) { console.error(`Build ${m[1]} failed on ${m[2]}; inspect errorText`); }\n  else throw e;\n}","preventionTips":["Validate the data model on the branch before triggering a build","Treat build failure messages as carrying the API errorText — parse and surface it","Retry builds only after addressing the reported reason"],"tags":["cli","build","deployments","ci"],"backgroundTag":"build-failed","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}