{"record":{"id":"48ba256c3d277922","repo":"cube-js/cube","slug":"data-model-on-branch-could-not-be-validated-the","errorCode":null,"errorMessage":"data model on {branch} could not be validated (the API reported a failure without any compilation errors)","messagePattern":"data model on (.+?) could not be validated \\(the API reported a failure without any compilation errors\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cube-cli/src/commands/validate.rs","lineNumber":127,"sourceCode":"    } else if !errors.is_empty() {\n        // Compilation errors go to stderr so `cube validate --json` stays\n        // machine-readable on stdout and a human run stays readable when\n        // stdout is piped.\n        eprintln!(\"{} Data model on {branch} failed to compile:\", \"✗\".red());\n        for error in &errors {\n            eprintln!(\"  {}\", format_error(error));\n        }\n    }\n\n    if !valid {\n        // Non-zero exit is the point of the command in CI, so it holds in\n        // --json mode too, where the report above was printed as JSON.\n        //\n        // With nothing to list there is no stderr header above it: the header\n        // exists to introduce a list, and repeating the verdict on two lines\n        // says less than the one line that also says what to look at.\n        if errors.is_empty() {\n            bail!(\n                \"data model on {branch} could not be validated \\\n                 (the API reported a failure without any compilation errors)\"\n            );\n        }\n        bail!(\n            \"data model on {branch} has {} compilation error(s)\",\n            errors.len()\n        );\n    }\n\n    Ok(())\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use serde_json::json;\n","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cube-cli/src/commands/validate.rs#L109-L145","documentation":"`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.","triggerScenarios":"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.","commonSituations":"Stale CLI version against a newer API; branch in a broken infrastructural state; API gateway returning 500 wrapped as a validation failure.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  run(`cube validate --branch ${branch}`);\n} catch (e) {\n  if (String(e).includes(\"could not be validated\")) {\n    // API gave no error details — retry once, then escalate\n    await sleep(10_000); run(`cube validate --branch ${branch}`);\n  } else throw e;\n}","preventionTips":["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"],"tags":["cli","validate","data-model","api"],"backgroundTag":"empty-validation-report","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}