{"record":{"id":"47419206a17cfb7c","repo":"BoundaryML/baml","slug":"version-check-failed","errorCode":null,"errorMessage":"Version check failed","messagePattern":"Version check failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/cli/src/deploy.rs","lineNumber":101,"sourceCode":"impl Deployer {\n    async fn run_async(&self) -> Result<()> {\n        let cloud_projects = self.runtime.cloud_projects();\n\n        let version_check_errors = cloud_projects\n            .iter()\n            .filter_map(|cloud_project| {\n                generators_lib::version_check::check_version(\n                    &cloud_project.version,\n                    env!(\"CARGO_PKG_VERSION\"),\n                    generators_lib::version_check::GeneratorType::CLI,\n                    generators_lib::version_check::VersionCheckMode::Strict,\n                    baml_types::GeneratorOutputType::OpenApi,\n                    false,\n                )\n            })\n            .collect::<Vec<_>>();\n        if !version_check_errors.is_empty() {\n            let mut err = anyhow::anyhow!(\"Version check failed\");\n            for error in version_check_errors.iter() {\n                err = err.context(error.msg());\n            }\n            return Err(err);\n        }\n\n        if cloud_projects.is_empty() {\n            self.deploy_new_project().await?;\n        } else {\n            for cloud_project in cloud_projects {\n                self.deploy_project_no_progress_spinner(\n                    &cloud_project.project_fqn,\n                    IndexMap::new(),\n                )\n                .with_progress_spinner(\n                    format!(\"Deploying to {}\", cloud_project.project_fqn),\n                    |_| \"done!\".to_string(),\n                    \"something went wrong.\",","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/cli/src/deploy.rs#L83-L119","documentation":"During `baml deploy`, the CLI runs a version check over all generated client targets (e.g. OpenAPI outputs). If any generator reports a version problem, deployment aborts with this top-level error and the individual messages attached as context.","triggerScenarios":"Running deploy when one or more version_check_errors were collected while regenerating/validating client artifacts, e.g. a generator emitting code requiring a newer baml runtime than installed, or a mismatched generator version in baml.config.","commonSituations":"BAML CLI and installed runtime packages out of sync after upgrading only one side; pinning an old generator version in baml.config.json; CI cache with stale generated clients.","solutions":["Read the contextual error lines above/below this message to identify the failing generator","Upgrade the BAML CLI and all baml runtime packages to the same version (e.g. `pip install -U baml-py` / `npm i @boundaryml/baml`)","Regenerate clients (`baml generate`) after upgrading, then redeploy","Pin matching versions in baml.config.json and your lockfile"],"exampleFix":"// before (mismatch)\n\"pin\": \"0.80.0\" while CLI is 0.85.0\n// after\nbaml-cli version check && pip install \"baml-py==<cli-version>\" && baml generate","handlingStrategy":"try-catch","validationCode":"// before deploying\nconst cliVer = execSync('baml --version').toString().trim();\nconst runtimeVer = require('@boundaryml/baml/package.json').version;\nif (cliVer !== runtimeVer) console.warn('BAML CLI/runtime version mismatch');","typeGuard":null,"tryCatchPattern":"try {\n  await deploy();\n} catch (e) {\n  if (String(e).includes('Version check failed')) {\n    // inspect chained contexts and realign versions\n  }\n}","preventionTips":["Keep CLI and runtime packages on identical versions","Pin BAML versions in lockfiles","Run `baml generate` after every upgrade"],"tags":["cli","deploy","version-check"],"backgroundTag":"http-error-response","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}