{"record":{"id":"130c6b373c35ba01","repo":"apache/beam","slug":"malformed-components-v-lacks-a-conforming-pipeline-component","errorCode":null,"errorMessage":"malformed components; %v lacks a conforming pipeline component","messagePattern":"malformed components; (.+?) lacks a conforming pipeline component","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/xlang.go","lineNumber":241,"sourceCode":"\t\tid := fmt.Sprintf(\"%s_%s\", \"impulse\", tag)\n\t\timpulseIDs = append(impulseIDs, id)\n\t}\n\n\tfor _, id := range impulseIDs {\n\t\tt := transforms[id]\n\t\tif t.GetSpec().GetUrn() == URNImpulse {\n\t\t\tdelete(transforms, id)\n\t\t}\n\t}\n}\n\n// ExpandedComponents type asserts the Components field with any type\n// and returns its pipeline component proto representation\nfunc ExpandedComponents(exp *graph.ExpandedTransform) (*pipepb.Components, error) {\n\tif c, ok := exp.Components.(*pipepb.Components); ok {\n\t\treturn c, nil\n\t}\n\treturn nil, errors.Errorf(\"malformed components; %v lacks a conforming pipeline component\", exp)\n}\n\n// ExpandedTransform type asserts the Transform field with any type\n// and returns its pipeline ptransform proto representation\nfunc ExpandedTransform(exp *graph.ExpandedTransform) (*pipepb.PTransform, error) {\n\tif t, ok := exp.Transform.(*pipepb.PTransform); ok {\n\t\treturn t, nil\n\t}\n\treturn nil, errors.Errorf(\"malformed transform; %v lacks a conforming pipeline ptransform\", exp)\n}\n\n// ExternalInputs returns the map (tag -> graph node representing the\n// pcollection) of input nodes with respect to the map (tag -> index of Inbound\n// in MultiEdge.Input) of named inputs\nfunc ExternalInputs(e *graph.MultiEdge) map[string]*graph.Node {\n\treturn InboundTagToNode(e.External.InputsMap, e.Input)\n}\n","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/xlang.go#L223-L259","documentation":"ExpandedComponents type-asserts an ExpandedTransform's Components field to *pipepb.Components. This error is returned when the stored value is nil or of a different type, meaning the expansion result does not carry a valid pipeline components proto.","triggerScenarios":"Calling ExpandedComponents (directly or via mergeExpandedWithPipeline, ResolveOutputIsBounded, ResolveArtifactsWithConfig, UpdateArtifactTypeFromFileToURL) on a graph.ExpandedTransform whose Components was never set to *pipepb.Components.","commonSituations":"Constructing graph.ExpandedTransform manually without a components proto; test fakes populating Components with the wrong type; corrupted expansion results stored under a different concrete type.","solutions":["Ensure the expansion path sets Components to a *pipepb.Components before use.","Fix test fakes/custom code to store the correct proto type in ExpandedTransform.Components.","Re-run the expansion with TryCrossLanguage rather than hand-populating ExpandedTransform."],"exampleFix":"// before\nexp := &graph.ExpandedTransform{Transform: &pipepb.PTransform{}}\n// after\nexp := &graph.ExpandedTransform{Transform: &pipepb.PTransform{}, Components: &pipepb.Components{}}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func hasValidComponents(exp *graph.ExpandedTransform) bool {\n    _, ok := exp.Components.(*pipepb.Components)\n    return ok\n}","tryCatchPattern":"if c, err := graphx.ExpandedComponents(exp); err != nil {\n    return fmt.Errorf(\"expansion lacks components: %w\", err)\n}","preventionTips":["Never hand-populate graph.ExpandedTransform in production code.","Use TryCrossLanguage to build expanded transforms.","In tests, assert the concrete proto types when constructing fakes."],"tags":["go","apache-beam","cross-language","type-assertion"],"backgroundTag":"type-mismatch","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}