{"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/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/topology/schema.rs#L28-L64","documentation":"During topology schema computation, possible_definitions unwraps a source's output for a given port that source_output_for_port already reported as existing (Ok(Some(_))), so the None branch is marked unreachable. Hitting it means source_output_for_port and its output lookup disagree — the source claimed to have an output for the port but returned None. This indicates a source implementation bug or an inconsistent build unit graph.","triggerScenarios":"A source component whose output implementation returns Ok(None) for a port it earlier reported as existing; adding a custom source with a misimplemented output_for_port; race/regression in topology builder against source unit metadata.","commonSituations":"Developing a custom Vector source with named output ports; Vector version mismatches between library crates where the topology and source code disagree.","solutions":["Inspect the source implementation's output_for_port to ensure it cannot return Ok(None) for a port it advertises","Rebuild with consistent crate versions to rule out a stale build","File/check a Vector bug with the topology config that triggers it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate the topology before schema expansion\nvector validate --no-environment config.yaml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Implement custom source output_for_port to never return Ok(None) for advertised ports","Keep all Vector crates on the same version in embedded builds","Rebuild cleanly after touching component metadata code"],"tags":["rust","topology","schema","panic"],"backgroundTag":"internal-invariant-violation","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"}