{"record":{"id":"dba89c154bac403f","repo":"xai-org/grok-build","slug":"exited-with-status","errorCode":null,"errorMessage":"{} exited with {status}","messagePattern":"(.+?) exited with (.+?)","errorType":"exception","errorClass":"ManagedConfigError","httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-config/src/managed_text/validator.rs","lineNumber":102,"sourceCode":"                    path,\n                    format!(\"{} exited with {status}\", validator.program.display()),\n                    None,\n                ));\n            }\n            Ok(None) if started.elapsed() < validator.timeout => {\n                std::thread::sleep(Duration::from_millis(10));\n            }\n            Ok(None) => {\n                let teardown = ops.teardown(&mut child, group.as_ref()).err();\n                return Err(validation_error(\n                    path,\n                    format!(\"timed out after {:?}\", validator.timeout),\n                    teardown,\n                ));\n            }\n            Err(source) => {\n                let teardown = ops.teardown(&mut child, group.as_ref()).err();\n                return Err(validation_error(path, source.to_string(), teardown));\n            }\n        }\n    }\n}\n\nfn validation_error(path: &Path, primary: String, teardown: Option<String>) -> ManagedConfigError {\n    let reason = match teardown {\n        Some(teardown) => format!(\"{primary}; process teardown also failed: {teardown}\"),\n        None => primary,\n    };\n    ManagedConfigError::Validation {\n        path: path.to_path_buf(),\n        reason,\n    }\n}\n\nfn teardown_child(\n    child: &mut Child,","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-config/src/managed_text/validator.rs#L84-L120","documentation":"The validator child process finished but with a failure: it reported an error through its output/exit path, so validation returns '{path} exited with {status}'. The library surfaces the validator's own failure status plus any teardown error, meaning the file being validated did not pass the external tool's checks or the tool itself crashed.","triggerScenarios":"The spawned validator command exits non-zero or signals (e.g. `ExitStatus` failure) while validating the config file — syntax errors in the target file, missing validator dependencies, bad CLI arguments in the configured command, or the binary crashing.","commonSituations":"Malformed config file content that the linter rejects; validator binary not installed or not on PATH in a different environment (CI vs dev); validator invoked with flags that changed between versions; resource limits (OOM) killing the process.","solutions":["Read the captured validator output/teardown detail to see the exact exit status and diagnostics.","Run the validator command manually against the file to reproduce and fix the underlying syntax/quality error it reports.","Verify the validator binary is installed and on PATH in the environment where validation runs.","Update the configured validator command/flags to match the installed tool's version."],"exampleFix":"// before: file has a syntax error, validator exits 1\n// myconf.toml\nkey = value\n// after: fix the file\nkey = \"value\"","handlingStrategy":"validation","validationCode":"# validate the file content and tool availability before invoking managed validation\ncommand -v $VALIDATOR_BIN || { echo \"validator not installed\"; exit 1; }\n$VALIDATOR_BIN --check /path/to/file.conf","typeGuard":null,"tryCatchPattern":"match validate_temp(path) {\n  Err(ManagedConfigError::Validation(msg)) if msg.contains(\"exited with\") => {\n    eprintln!(\"validator rejected the file: {msg}\");\n    eprintln!(\"run the validator manually for full diagnostics\");\n  }\n  Err(e) => return Err(e),\n  Ok(v) => apply(v),\n}","preventionTips":["Lint/validate config files in the editor before running managed validation","Ensure the validator binary is installed and on PATH in every environment","Pin validator versions and keep configured flags in sync","Capture and read the validator's full output on failure"],"tags":["exit-status","process-spawn","validation","config"],"backgroundTag":"nonzero-exit-code","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}