{"record":{"id":"b5a60e2294020e6c","repo":"vectordotdev/vector","slug":"transform-must-exist","errorCode":null,"errorMessage":"transform must exist","messagePattern":"transform must exist","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/topology/schema.rs","lineNumber":267,"sourceCode":"        // If the input is a transform we recurse to the upstream components to retrieve\n        // their definitions and pass it through the transform to get the new definitions.\n        if let Some(inputs) = config.transform_inputs(key) {\n            let transform_definitions =\n                input_definitions(inputs, config, enrichment_tables.clone(), cache)?;\n\n            if contains_never(&transform_definitions) {\n                return Err(Error::ContainsNever);\n            }\n\n            let mut transform_definitions = input.with_definitions(\n                config\n                    .transform_output_for_port(\n                        key,\n                        &input.port,\n                        enrichment_tables.clone(),\n                        &transform_definitions,\n                    )\n                    .expect(\"transform must exist\")\n                    .unwrap_or_else(|| {\n                        unreachable!(\n                            \"transform output misconfigured - output for port {:?} missing\",\n                            &input.port\n                        )\n                    })\n                    .schema_definitions(config.schema_enabled())\n                    .values()\n                    .cloned(),\n            );\n\n            if contains_never(&transform_definitions) {\n                return Err(Error::ContainsNever);\n            }\n\n            definitions.append(&mut transform_definitions);\n        }\n    }","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/topology/schema.rs#L249-L285","documentation":"Vector builds the input definitions for a topology node and looks up each transform's output schema for the port a downstream input consumes. `.transform_output_for_port(...)` returns an Option<Result<..>>; the code asserts the transform key must be present in `transform_definitions` and panics with \"transform must exist\" if not. This is an internal consistency invariant: every input edge should reference a transform that was already resolved during config building.","triggerScenarios":"A topology input references a transform component key that is absent from `transform_definitions` — i.e. config graph resolution produced an edge to a transform that was never collected, or a custom/patched build path dropped a transform node while keeping its edges.","commonSituations":"Hand-edited or generated config where a `transforms:` entry was deleted but a downstream component still references it; routing/multiple-output transforms whose port wiring got out of sync after a config refactor; bugs in custom forks modifying the topology builder.","solutions":["Fix the Vector config so every consumer references an existing transform id (check `transforms:` keys vs `inputs:` lists)","Run `vector validate --no-environment <config>` before starting to catch dangling references","Rebuild from a clean state to rule out stale generated definitions","If the config is correct, file a bug with the config file — this is a topology-builder invariant violation"],"exampleFix":"// before (config)\ntransforms:\n  parse_logs: {}\nrouters:\n  main:\n    inputs: [\"missing_transform\"]\n// after\ntransforms:\n  parse_logs: {}\nrouters:\n  main:\n    inputs: [\"parse_logs\"]","handlingStrategy":"validation","validationCode":"// pre-flight: ensure every input references an existing transform\nfor (id, c) in &config.transforms {\n    for input in &c.inputs {\n        assert!(config.transforms.contains_key(input), \"dangling transform ref: {input}\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `vector validate` on every config before deploy","Keep transform ids and inputs lists in sync during refactors","Use schema checks/linting in CI for Vector configs","Avoid hand-editing generated configs"],"tags":["rust","topology","config"],"backgroundTag":"entity-not-found","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"}