{"record":{"id":"dae432be7e8f81a7","repo":"vectordotdev/vector","slug":"component-examples","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/check/component_examples.rs","lineNumber":459,"sourceCode":"\n    let output = Command::new(vector_bin)\n        .current_dir(repo_root)\n        .args([\"validate\", \"--no-environment\", \"--skip-healthchecks\"])\n        .arg(temporary.path())\n        .output()\n        .with_context(|| format!(\"Failed to validate {}\", case.key))?;\n\n    if output.status.success() {\n        return Ok(());\n    }\n    let stderr = String::from_utf8_lossy(&output.stderr);\n    let stdout = String::from_utf8_lossy(&output.stdout);\n    let details = if stderr.trim().is_empty() {\n        &stdout\n    } else {\n        &stderr\n    };\n    bail!(\"{}\", summarize_error(details))\n}\n\nfn summarize_error(error: &str) -> &str {\n    error\n        .lines()\n        .find(|line| {\n            let line = line.trim();\n            !line.contains(\"Failed to load\") && !line.starts_with(\"error[\") && line.contains(\"x \")\n        })\n        .or_else(|| error.lines().find(|line| !line.trim().is_empty()))\n        .unwrap_or(error)\n        .trim()\n        .trim_start_matches(\"x \")\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/check/component_examples.rs#L441-L477","documentation":"A single example validation case failed: `vdev` ran the built `vector` binary against the generated example config and it exited non-zero. The error message is the summarized relevant portion of Vector's stdout/stderr produced by `summarize_error`.","triggerScenarios":"`vector validate <example>` returns a non-zero exit code for one validation case — e.g. schema errors, unknown fields, failed component builds — and `validate_case` bails with the summarized output.","commonSituations":"Generated example references a config option that no longer exists, an option changed type, or the example requires features not compiled into the debug binary.","solutions":["Read the summarized error text in the message; it contains Vector's own validation error.","Fix the source docs/metadata that generates the example (or the component config schema).","Regenerate with `make generate-docs` and re-run the check."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let out = Command::new(\"./target/debug/vector\").arg(\"validate\").arg(\"--no-environment\").arg(config).output()?;\nassert!(out.status.success(), \"{}\", String::from_utf8_lossy(&out.stderr));","typeGuard":null,"tryCatchPattern":"let output = cmd.output().context(\"failed to run vector\")?;\nif !output.status.success() {\n    bail!(\"vector validate failed (exit {:?}): {}\", output.status.code(), String::from_utf8_lossy(&output.stderr));\n}","preventionTips":["Run the failing example config through `vector validate` locally to see the full error.","Keep examples regenerated after schema changes.","Ensure required features are compiled into the validation binary."],"tags":["validation","config","vector"],"backgroundTag":"invalid-config-value","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}