{"record":{"id":"c57790d653574fa2","repo":"vectordotdev/vector","slug":"source-output-misconfigured","errorCode":null,"errorMessage":"source output misconfigured","messagePattern":"source output misconfigured","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/topology/schema.rs","lineNumber":151,"sourceCode":"            // After getting the source matching to the given input, we need to further narrow the\n            // actual output of the source feeding into this input, and then get the definition\n            // belonging to that output.\n            let mut source_definitions =\n                outputs\n                    .into_iter()\n                    .find_map(|output| {\n                        if output.port == input.port {\n                            Some(input.with_definitions(\n                                output.schema_definition(config.schema_enabled()),\n                            ))\n                        } else {\n                            None\n                        }\n                    })\n                    .unwrap_or_else(|| {\n                        // If we find no match, it means the topology is misconfigured. This is a fatal\n                        // error, but other parts of the topology builder deal with this state.\n                        unreachable!(\"source output misconfigured\")\n                    });\n\n            if contains_never(&source_definitions) {\n                return Err(Error::ContainsNever);\n            }\n\n            definitions.append(&mut source_definitions);\n\n        // A transform can receive from multiple inputs, and each input needs to be expanded to\n        // a new pipeline.\n        } else if let Some(inputs) = config.transform_inputs(key) {\n            let input_definitions =\n                possible_definitions(inputs, config, enrichment_tables.clone(), &mut merged_cache)?;\n\n            let mut transform_definition = config\n                .transform_outputs(key, enrichment_tables.clone(), &input_definitions)\n                .expect(\"already found inputs\")\n                .iter()","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/topology/schema.rs#L133-L169","documentation":"expanded_definitions matches a sink's required input against candidate source definitions; on no match it raises unreachable! because topology validation elsewhere should have rejected a misconfigured graph first. Reaching it means an invalid sink→source connection slipped past earlier validation, so the schema layer hits dead code. The comment in the source confirms the topology builder owns this error state; this panic is a safety net.","triggerScenarios":"A sink's inputs referencing a source/port that does not exist or emits incompatible types, while the earlier validation pass did not reject the config; programmatic topology construction bypassing validate().","commonSituations":"Hand-built topologies in embedded usage; Vector bugs where validation and schema expansion disagree; typos in port names combined with a validation skip (e.g. --skip-healthchecks style paths or tests).","solutions":["Run vector validate on the config and fix the sink inputs to reference existing source outputs/ports","Ensure topology construction goes through the standard builder/validation path","Upgrade Vector; if reproducible with a stock config, file a bug with the config"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check sink inputs resolve to real source outputs before building\nvector validate config.yaml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fix sink inputs to reference existing source outputs and ports","Always build topologies through the validated builder path","Run vector validate in CI for every config change"],"tags":["rust","topology","schema","panic","validation"],"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"}