{"record":{"id":"20322e01561ec8f5","repo":"apache/beam","slug":"mismatch-d-counts-between-external-tags-v-and-inputs-v","errorCode":null,"errorMessage":"mismatch'd counts between External tags (%v) and inputs (%v)","messagePattern":"mismatch'd counts between External tags \\((.+?)\\) and inputs \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/translate.go","lineNumber":690,"sourceCode":"\t\tspec = &pipepb.FunctionSpec{Urn: URNGBK}\n\n\tcase graph.WindowInto:\n\t\twindowFn, err := makeWindowFn(edge.Edge.WindowFn)\n\t\tif err != nil {\n\t\t\treturn handleErr(err)\n\t\t}\n\t\tpayload := &pipepb.WindowIntoPayload{\n\t\t\tWindowFn: windowFn,\n\t\t}\n\t\tspec = &pipepb.FunctionSpec{Urn: URNWindow, Payload: protox.MustEncode(payload)}\n\n\tcase graph.External:\n\t\tpyld := edge.Edge.Payload\n\t\tspec = &pipepb.FunctionSpec{Urn: pyld.URN, Payload: pyld.Data}\n\n\t\tif len(pyld.InputsMap) != 0 {\n\t\t\tif got, want := len(pyld.InputsMap), len(edge.Edge.Input); got != want {\n\t\t\t\treturn handleErr(errors.Errorf(\"mismatch'd counts between External tags (%v) and inputs (%v)\", got, want))\n\t\t\t}\n\t\t\tinputs = make(map[string]string)\n\t\t\tfor tag, in := range InboundTagToNode(pyld.InputsMap, edge.Edge.Input) {\n\t\t\t\tif _, err := m.addNode(in); err != nil {\n\t\t\t\t\treturn handleErr(err)\n\t\t\t\t}\n\t\t\t\tinputs[tag] = nodeID(in)\n\t\t\t}\n\t\t}\n\n\t\tif len(pyld.OutputsMap) != 0 {\n\t\t\tif got, want := len(pyld.OutputsMap), len(edge.Edge.Output); got != want {\n\t\t\t\treturn handleErr(errors.Errorf(\"mismatch'd counts between External tags (%v) and outputs (%v)\", got, want))\n\t\t\t}\n\t\t\toutputs = make(map[string]string)\n\t\t\tfor tag, out := range OutboundTagToNode(pyld.OutputsMap, edge.Edge.Output) {\n\t\t\t\tif _, err := m.addNode(out); err != nil {\n\t\t\t\t\treturn handleErr(err)","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/translate.go#L672-L708","documentation":"For graph.External edges, the External payload declares an InputsMap of tags. If the number of tags in InputsMap doesn't equal the number of actual input edges on the graph node, the mapping is inconsistent and addMultiEdge aborts via handleErr, reporting both counts.","triggerScenarios":"Marshalling a pipeline containing an External transform (cross-language / expansion payload) whose pyld.InputsMap length differs from len(edge.Edge.Input) — e.g. the external payload was constructed with mismatched tag lists.","commonSituations":"Building External transforms by hand with wrong inputs map; cross-language transforms whose payload was generated by an older runner SDK; custom I/O connectors with changed arity between versions.","solutions":["Rebuild the External transform with a correctly sized InputsMap matching the input count","Regenerate the external payload with a matching SDK/runner version","Check InboundTagToNode inputs: each tag must correspond to one edge input","If hand-writing cross-language transforms, verify tag names and counts in the payload"],"exampleFix":"// before\npyld := graph.Payload{URN: urn, InputsMap: map[string]int{\"a\":0}} // 1 tag, 2 inputs\n// after\npyld := graph.Payload{URN: urn, InputsMap: map[string]int{\"a\":0,\"b\":1}}","handlingStrategy":"validation","validationCode":"// Before marshalling external transforms, validate tag/input arity\nif len(pyld.InputsMap) != 0 && len(pyld.InputsMap) != len(edge.Input) {\n    return fmt.Errorf(\"external %q: %d tags vs %d inputs\", pyld.URN, len(pyld.InputsMap), len(edge.Input))\n}","typeGuard":null,"tryCatchPattern":"if _, err := graphx.Marshal(p); err != nil {\n    if strings.Contains(err.Error(), \"External tags\") && strings.Contains(err.Error(), \"inputs\") {\n        return fmt.Errorf(\"external transform payload inconsistent: %v\", err)\n    }\n    return err\n}","preventionTips":["Generate external payloads with the same SDK version used for marshalling","Count inputs/outputs of cross-language transforms when defining tags","Test cross-language pipelines end-to-end in CI"],"tags":["go","apache-beam","external-transform","cross-language"],"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-14T16:17:12.679Z"}