cube-js/cube · error
data model on {branch} could not be validated (the API repor
Error message
data model on {branch} could not be validated (the API reported a failure without any compilation errors) What it means
`cube validate` asks the API to validate the data model on a branch and expects a list of compilation errors on failure. If the API reports overall failure but returns no per-error details, the CLI cannot print a useful report and bails with this message instead of listing zero errors.
Source
Thrown at rust/cube-cli/src/commands/validate.rs:127
} else if !errors.is_empty() {
// Compilation errors go to stderr so `cube validate --json` stays
// machine-readable on stdout and a human run stays readable when
// stdout is piped.
eprintln!("{} Data model on {branch} failed to compile:", "✗".red());
for error in &errors {
eprintln!(" {}", format_error(error));
}
}
if !valid {
// Non-zero exit is the point of the command in CI, so it holds in
// --json mode too, where the report above was printed as JSON.
//
// With nothing to list there is no stderr header above it: the header
// exists to introduce a list, and repeating the verdict on two lines
// says less than the one line that also says what to look at.
if errors.is_empty() {
bail!(
"data model on {branch} could not be validated \
(the API reported a failure without any compilation errors)"
);
}
bail!(
"data model on {branch} has {} compilation error(s)",
errors.len()
);
}
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
use serde_json::json;
View on GitHub (pinned to 7d981676b3)
Solutions
- Re-run the validation — the failure may be transient
- Check API reachability and authentication (`cube login`, CUBE_API_URL/CUBE_API_KEY)
- Update the CLI; if it persists, inspect raw API responses or report the issue
Defensive patterns
Strategy: retry
Try / catch
try {
run(`cube validate --branch ${branch}`);
} catch (e) {
if (String(e).includes("could not be validated")) {
// API gave no error details — retry once, then escalate
await sleep(10_000); run(`cube validate --branch ${branch}`);
} else throw e;
} Prevention
- Keep CLI version current so response shapes are parsed correctly
- Check auth/permissions before validating protected branches
- Treat empty-error failures as API-side issues, not model issues
When it happens
Trigger: Running `cube validate --branch <branch>` where the validation API returns a failure status with an empty errors array — e.g. API-side failure unrelated to compilation, auth/permission issues swallowed by the API, or an unexpected response shape.
Common situations: Stale CLI version against a newer API; branch in a broken infrastructural state; API gateway returning 500 wrapped as a validation failure.
Related errors
- data model on {branch} has {} compilation error(s)
- A user's selector doesn't match any of the pre-aggregations
- ${pkg} dependency not found. Please run this command from pr
- No app secret found
- Provided token isn't for ${dotCubeCloud.url}
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/48ba256c3d277922.
Report an issue: GitHub.