vectordotdev/vector · error

Component kind is not an object

Error message

Component kind {kind} is not an object

What it means

Type guard while iterating the docs model: under components, each kind key ('sources', 'transforms', 'sinks', ...) must map to an object of components. This fires when the value for {kind} is an array, string, or null, meaning the generated documentation model has an unexpected shape for that kind and per-kind example validation cannot proceed.

Solutions

  1. Regenerate the documentation model to restore the expected per-kind object shape
  2. Check for manual edits to the generated JSON that changed the kind mapping to a non-object
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at vdev/src/commands/check/component_examples.rs:127 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/4ee9413fd316a734. Report an issue: GitHub.

Appendix: source

Thrown at vdev/src/commands/check/component_examples.rs:127

    bail!("{} validation failure(s).", failures.len())
}

fn validation_cases(
    examples_dir: &Path,
    docs: &Value,
) -> Result<(Vec<ValidationCase>, usize, usize)> {
    let components = docs
        .get("components")
        .and_then(Value::as_object)
        .ok_or_else(|| anyhow!("Documentation model has no components"))?;
    let mut cases = Vec::new();
    let mut total = 0;
    let mut skipped = 0;

    for (kind, components_of_kind) in components {
        let components_of_kind = components_of_kind
            .as_object()
            .ok_or_else(|| anyhow!("Component kind {kind} is not an object"))?;
        for (component_type, component) in components_of_kind {
            for variant in ["minimal", "advanced"] {
                total += 1;
                let key = format!("{kind}/{component_type} ({variant})");
                let path = examples_dir
                    .join(kind)
                    .join(component_type)
                    .join(format!("{variant}.yaml"));
                let yaml = fs::read_to_string(&path)
                    .with_context(|| format!("Could not read {}", path.display()))?;
                let yaml = serde_yaml::from_str(&yaml)
                    .with_context(|| format!("YAML parse error for {key}"))?;

                let Some(config) = wrap_config(kind, yaml, component)? else {
                    skipped += 1;
                    continue;
                };
                cases.push(ValidationCase { key, config });

View on GitHub (pinned to bdb87aeaa4)