{"record":{"id":"3f8b4dc9360fc880","repo":"vectordotdev/vector","slug":"source-output-has-no-name","errorCode":null,"errorMessage":"Source output has no name","messagePattern":"Source output has no name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/check/component_examples.rs","lineNumber":187,"sourceCode":"        mapping_value(&root, \"sources\")\n            .ok_or_else(|| anyhow!(\"Source example has no sources section\"))?,\n        \"source example sources\",\n    )?;\n    let source_key = mapping_key(&sources, \"source example\")?;\n    let mut sinks = Mapping::new();\n\n    let outputs = component.get(\"outputs\").and_then(Value::as_array);\n    let has_named_outputs = outputs\n        .and_then(|outputs| outputs.first())\n        .and_then(|output| output.get(\"name\"))\n        .and_then(Value::as_str)\n        .is_some_and(|name| name != \"<component_id>\");\n    if has_named_outputs {\n        for output in outputs.expect(\"Named outputs require an output list\") {\n            let name = output\n                .get(\"name\")\n                .and_then(Value::as_str)\n                .ok_or_else(|| anyhow!(\"Source output has no name\"))?;\n            sinks.insert(\n                YamlValue::String(format!(\"_validate_sink_{name}\")),\n                blackhole(&format!(\"{source_key}.{name}\")),\n            );\n        }\n    } else {\n        sinks.insert(\n            YamlValue::String(\"_validate_sink\".to_owned()),\n            blackhole(&source_key),\n        );\n    }\n    root.insert(\n        YamlValue::String(\"sinks\".to_owned()),\n        YamlValue::Mapping(sinks),\n    );\n    Ok(YamlValue::Mapping(root))\n}\n","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/check/component_examples.rs#L169-L205","documentation":"When a source declares named outputs, `wrap_source` iterates the output list to generate one validation sink per named output. If an output entry has no `name` field (or it is not a string), the wrapper cannot reference the output and throws this error.","triggerScenarios":"A source's `outputs` array contains an entry lacking a `name` key, or with a non-string `name`, while the source otherwise qualifies as having named outputs (names other than `<component_id>`).","commonSituations":"A developer added a new named output to a source's example and forgot the `name` field; the outputs list was copied from a component that uses the legacy default output; YAML typo like `nane:` or `name: [list]`.","solutions":["Add a `name` string field to every entry in the source example's `outputs` list.","Remove the `outputs` list if the source only has a default output.","Check the source's Rust `VectorSink:: Outputs`/schema definition matches the names used in the example YAML."],"exampleFix":"// before\noutputs:\n  - type: log\n\n// after\noutputs:\n  - name: processed\n    type: log","handlingStrategy":"validation","validationCode":"const outputs = component.outputs ?? [];\nfor (const o of outputs) {\n  if (typeof o.name !== 'string' || o.name.length === 0) {\n    throw new Error('every named source output needs a string `name` field');\n  }\n}","typeGuard":"function isNamedOutput(o) {\n  return typeof o === 'object' && o !== null && typeof o.name === 'string' && o.name.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Match the example's outputs list to the source's Rust output definitions.","Lint example YAML schema before committing.","When adding an output, update the example config in the same PR."],"tags":["yaml","config-validation","vector"],"backgroundTag":"missing-required-config-field","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"}