{"record":{"id":"aeebd1943e8d8754","repo":"vectordotdev/vector","slug":"already-found-inputs","errorCode":null,"errorMessage":"already found inputs","messagePattern":"already found inputs","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/topology/schema.rs","lineNumber":168,"sourceCode":"                        // 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()\n                .find_map(|output| {\n                    if output.port == input.port {\n                        Some(\n                            input.with_definitions(\n                                output\n                                    .schema_definitions(config.schema_enabled())\n                                    .values()\n                                    .cloned(),\n                            ),\n                        )\n                    } else {\n                        None\n                    }\n                })\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                .expect(\"transform output misconfigured\");","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/topology/schema.rs#L150-L186","documentation":"`expanded_definitions` (src/topology/schema.rs:168) calls `config.transform_outputs(key, ..., &input_definitions).expect(\"already found inputs\")`. Because `input_definitions` were just computed by `possible_definitions`, the transform-outputs lookup cannot fail — inputs were proven to exist. A panic here means the config's transform registry changed or is inconsistent with the inputs that were found.","triggerScenarios":"Calling `expanded_definitions` (via validate_sink_expectations or test_expanded_definition) with a Config whose `transform_inputs(key)` succeeds but whose transform outputs resolver returns Err — i.e. an internally inconsistent or mutated Config.","commonSituations":"Tests constructing Config fragments by hand where the transform entry lacks outputs metadata; concurrent mutation of the config during validation.","solutions":["Ensure the transform has a valid outputs definition (schema-aware transforms must return outputs when inputs are provided).","Use configs produced by the standard parser rather than hand-assembled Config structs.","Keep the Config immutable across `possible_definitions` and `expanded_definitions` calls."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// transform must resolve outputs for its own inputs before schema expansion\nassert!(config.transform_outputs(key, enrichment.clone(), &input_definitions).is_ok());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the Config immutable across possible_definitions/expanded_definitions.","Build configs via the standard config loader so transform outputs metadata is complete.","Add unit checks in test harnesses that hand-build Config structs."],"tags":["rust","schema","vrl","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"}