vectordotdev/vector · error
Source output has no name
Error message
Source output has no name
What it means
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.
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.
Example fix
// before
outputs:
- type: log
// after
outputs:
- name: processed
type: log Defensive patterns
Strategy: validation
Validate before calling
const outputs = component.outputs ?? [];
for (const o of outputs) {
if (typeof o.name !== 'string' || o.name.length === 0) {
throw new Error('every named source output needs a string `name` field');
}
} Type guard
function isNamedOutput(o) {
return typeof o === 'object' && o !== null && typeof o.name === 'string' && o.name.length > 0;
} Prevention
- 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.
When it happens
Trigger: 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>`).
Common situations: 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]`.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- has no component identifier
- Sink example has no sinks section
- Sink is missing
- Source example has no sources section
- Transform example has no transforms section
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/3f8b4dc9360fc880.
Report an issue: GitHub.
Appendix: source
Thrown at vdev/src/commands/check/component_examples.rs:187
mapping_value(&root, "sources")
.ok_or_else(|| anyhow!("Source example has no sources section"))?,
"source example sources",
)?;
let source_key = mapping_key(&sources, "source example")?;
let mut sinks = Mapping::new();
let outputs = component.get("outputs").and_then(Value::as_array);
let has_named_outputs = outputs
.and_then(|outputs| outputs.first())
.and_then(|output| output.get("name"))
.and_then(Value::as_str)
.is_some_and(|name| name != "<component_id>");
if has_named_outputs {
for output in outputs.expect("Named outputs require an output list") {
let name = output
.get("name")
.and_then(Value::as_str)
.ok_or_else(|| anyhow!("Source output has no name"))?;
sinks.insert(
YamlValue::String(format!("_validate_sink_{name}")),
blackhole(&format!("{source_key}.{name}")),
);
}
} else {
sinks.insert(
YamlValue::String("_validate_sink".to_owned()),
blackhole(&source_key),
);
}
root.insert(
YamlValue::String("sinks".to_owned()),
YamlValue::Mapping(sinks),
);
Ok(YamlValue::Mapping(root))
}
View on GitHub (pinned to bdb87aeaa4)