{"record":{"id":"d8e8826c4ba17cc9","repo":"vectordotdev/vector","slug":"source-output-misconfigured-output-for-port","errorCode":null,"errorMessage":"source output misconfigured - output for port {:?} missing","messagePattern":"source output misconfigured - output for port (.+?) missing","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/topology/schema.rs","lineNumber":46,"sourceCode":"        return Ok(vec![]);\n    }\n\n    // Try to get the definition from the cache.\n    if let Some(definition) = cache.get(&(config.schema_enabled(), inputs.to_vec())) {\n        return Ok(definition.clone());\n    }\n\n    let mut definitions = Vec::new();\n\n    for input in inputs {\n        let key = &input.component;\n\n        // If the input is a source, the output is merged into the top-level schema.\n        if let Ok(maybe_output) = config.source_output_for_port(key, &input.port) {\n            let mut source_definition = input.with_definitions(\n                maybe_output\n                    .unwrap_or_else(|| {\n                        unreachable!(\n                            \"source output misconfigured - output for port {:?} missing\",\n                            &input.port\n                        )\n                    })\n                    .schema_definition(config.schema_enabled()),\n            );\n\n            if contains_never(&source_definition) {\n                return Err(Error::ContainsNever);\n            }\n\n            definitions.append(&mut source_definition);\n        }\n\n        // If the input is a transform, the output is merged into the top-level schema\n        if let Some(inputs) = config.transform_inputs(key) {\n            let input_definitions =\n                possible_definitions(inputs, config, enrichment_tables.clone(), cache)?;","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/src/topology/schema.rs#L28-L64","documentation":"During topology schema computation, every input that points at a source resolves that source's declared outputs by port (source_output_for_port returns Ok(Some(output)) on match, Ok(None) when the source declares no such port). An input referencing a source through an undeclared port hits unreachable!('source output misconfigured - output for port {:?} missing') - config validation should have rejected this earlier, so firing it means a validation gap or programmatic topology misuse.","triggerScenarios":"An inputs entry like { ref = \"dd_agent\", port = \"logs\" } where the multi-output source declares different port names, constructed in a way that bypassed the config-time port check; schema generation (schema.enabled = true) then walks the graph and trips the unreachable.","commonSituations":"A source's port names changing across Vector versions while configs pin the old names; configs generated programmatically with guessed port names; versions where multi-output port validation lagged behind the schema feature.","solutions":["Check the source's documented output ports and fix the input's port to one it actually declares (or omit port to use the default output)","Run `vector validate <config>` - the checker names the invalid reference before runtime","Upgrade Vector - port validation and schema generation stay aligned in newer releases","If generating configs programmatically, enumerate port names from the component schema instead of hardcoding"],"exampleFix":"# before\nsinks:\n  out:\n    type: console\n    inputs: [\"dd_agent.nonexistent_port\"]\n\n# after\nsinks:\n  out:\n    type: console\n    inputs: [\"dd_agent.logs\"]   # must match a declared source output","handlingStrategy":"validation","validationCode":"# CI gate before deploy:\nvector validate /etc/vector/*.toml --no-environment\n\n# And assert every referenced port exists (sketch): for each input reference\n# 'src.port', confirm 'src' is a source and its component docs' output list contains 'port'.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `vector validate` on every config change (CI and pre-deploy)","Derive port names from the component schema/docs, never from memory","Re-validate configs when upgrading Vector - port names evolve across versions"],"tags":["rust","vector","topology","schema","source-outputs","port","panic","config-validation"],"backgroundTag":"source-output-port-missing","analyzedSha":"3708c39b12a93212ed8b8d7510b4cc7769cb5864","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}