{"record":{"id":"772070d2079d4f17","repo":"apache/beam","slug":"missing-named-output-in-expanded-transform-v-is-expected-in","errorCode":null,"errorMessage":"missing named output in expanded transform: %v is expected in %v","messagePattern":"missing named output in expanded transform: (.+?) is expected in (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/xlang.go","lineNumber":141,"sourceCode":"\t}\n}\n\n// VerifyNamedOutputs ensures the expanded outputs correspond to the correct and expected named outputs\nfunc VerifyNamedOutputs(ext *graph.ExternalTransform) {\n\ttransform, err := ExpandedTransform(ext.Expanded)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\texpandedOutputs := transform.GetOutputs()\n\n\tif len(expandedOutputs) != len(ext.OutputsMap) {\n\t\tpanic(errors.Errorf(\"mismatched number of named outputs:\\nreceived - %v\\nexpected - %v\", len(expandedOutputs), len(ext.OutputsMap)))\n\t}\n\n\tfor tag := range ext.OutputsMap {\n\t\t_, exists := expandedOutputs[tag]\n\t\tif tag != graph.UnnamedOutputTag && !exists {\n\t\t\tpanic(errors.Errorf(\"missing named output in expanded transform: %v is expected in %v\", tag, expandedOutputs))\n\t\t}\n\t\tif tag == graph.UnnamedOutputTag && len(expandedOutputs) > 1 {\n\t\t\tpanic(errors.Errorf(\"mismatched number of unnamed outputs:\\nreceived - %v\\nexpected - 1\", len(expandedOutputs)))\n\t\t}\n\t}\n}\n\n// ResolveOutputIsBounded updates each Output node with respect to the received\n// expanded components to reflect if it is bounded or not\nfunc ResolveOutputIsBounded(e *graph.MultiEdge, isBoundedUpdater func(*graph.Node, bool)) {\n\text := e.External\n\texp := ext.Expanded\n\tcomponents, err := ExpandedComponents(exp)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\texpandedPCollections := components.GetPcollections()\n\ttransform, err := ExpandedTransform(exp)","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/xlang.go#L123-L159","documentation":"During VerifyNamedOutputs each expected tag from ext.OutputsMap must exist in the expanded transform's outputs. This panic fires when a named (non-empty) tag is declared locally but absent from the expansion service's expanded outputs.","triggerScenarios":"An output tag passed to beam.CrossTransform/Output is not present in the expandedOutputs map returned by the expansion service, while total counts happen to match.","commonSituations":"Typo or naming mismatch between local output tag and the remote transform's output tag; using the wrong URN/method so a different transform variant is expanded; version drift between SDK and expansion service.","solutions":["Correct output tag names to exactly match the remote transform's output tags.","Verify the expansion URN and underlying method select the intended transform version.","Query the expansion service for the transform's output tag list and regenerate the outputs map."],"exampleFix":"// before\nxlang.Output(\"outpu\", \"a\") // typo\n// after\nxlang.Output(\"output\", \"a\")","handlingStrategy":"validation","validationCode":"for tag := range outputsMap {\n    if tag != \"\" {\n        if _, ok := expandedOutputs[tag]; !ok {\n            return fmt.Errorf(\"tag %q not in expanded outputs %v\", tag, expandedOutputs)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        log.Fatalf(\"missing named output during expansion: %v\", r)\n    }\n}()","preventionTips":["Copy output tag names from the transform's documentation or expansion logs, never by memory.","Verify the URN/method selects the intended transform variant.","Test expansions against the target expansion service version in CI."],"tags":["go","apache-beam","cross-language","named-outputs"],"backgroundTag":"unexpected-response-shape","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"}