{"record":{"id":"024e660fba09f20a","repo":"apache/beam","slug":"unexpected-input-kind-v","errorCode":null,"errorMessage":"unexpected input kind: %v","messagePattern":"unexpected input kind: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/translate.go","lineNumber":478,"sourceCode":"\t\t\t\tsiWSpec, err := makeWindowFn(siWfn)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tsi[fmt.Sprintf(\"i%v\", i)] = &pipepb.SideInput{\n\t\t\t\t\tAccessPattern: &pipepb.FunctionSpec{\n\t\t\t\t\t\tUrn: URNMultimapSideInput,\n\t\t\t\t\t},\n\t\t\t\t\tViewFn: &pipepb.FunctionSpec{\n\t\t\t\t\t\tUrn: \"foo\",\n\t\t\t\t\t},\n\t\t\t\t\tWindowMappingFn: &pipepb.FunctionSpec{\n\t\t\t\t\t\tUrn:     mappingUrn,\n\t\t\t\t\t\tPayload: siWSpec.Payload,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn nil, errors.Errorf(\"unexpected input kind: %v\", edge)\n\t\t\t}\n\t\t}\n\n\t\tmustEncodeMultiEdge, err := mustEncodeMultiEdgeBase64(edge.Edge)\n\t\tif err != nil {\n\t\t\treturn handleErr(err)\n\t\t}\n\n\t\tpayload := &pipepb.ParDoPayload{\n\t\t\tDoFn: &pipepb.FunctionSpec{\n\t\t\t\tUrn:     URNDoFn,\n\t\t\t\tPayload: []byte(mustEncodeMultiEdge),\n\t\t\t},\n\t\t\tSideInputs: si,\n\t\t}\n\t\tif edge.Edge.DoFn.IsSplittable() {\n\t\t\tcoderID, err := m.coders.Add(edge.Edge.RestrictionCoder)\n\t\t\tif err != nil {","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/translate.go#L460-L496","documentation":"addMultiEdge encountered a graph edge whose input kind does not map to any known URN case when building the multi-input FunctionSpec for a ParDo-like transform. Only CoGBK, Windowed and similar known kinds are handled; anything else hits the default branch and the marshaller refuses to continue rather than emit a wrong proto.","triggerScenarios":"Marshalling a pipeline whose transform edge has an unexpected InputKind — typically an internal inconsistency in the constructed graph, or a manually-built graph with an unhandled edge type.","commonSituations":"Hand-assembling graph.Edge objects in tests or custom code with kinds the translator doesn't support; SDK-internal bugs after upgrading where new edge kinds aren't handled.","solutions":["Inspect the edge printed in the error and its InputKind","Use supported combinators (beam.ParDo, beam.CoGroupByKey, beam.WindowInto) instead of hand-built edges","Upgrade or downgrade the SDK to a version where the edge kind is supported","File an issue with Beam if a standard combinator triggers it"],"exampleFix":"// before: hand-built edge with unknown kind\nedge := graph.Edge{Input: graph.MainUnknown}\n// after: build via public API\nout := beam.ParDo(p, fn, in)","handlingStrategy":"validation","validationCode":"// Before marshalling, walk the graph and assert every edge input kind is supported\nfor _, e := range g.Edges {\n    if !supportedInputKinds[e.Input.Kind] {\n        return fmt.Errorf(\"edge %s has unsupported input kind %v\", e.Name, e.Input.Kind)\n    }\n}","typeGuard":"func isSupportedKind(k graph.InputKind) bool {\n    switch k {\n    case graph.Main, graph.CoGBK, graph.Windowed:\n        return true\n    }\n    return false\n}","tryCatchPattern":"if _, err := graphx.Marshal(p); err != nil {\n    if strings.Contains(err.Error(), \"unexpected input kind\") {\n        return fmt.Errorf(\"pipeline uses unsupported edge construction: %v\", err)\n    }\n    return err\n}","preventionTips":["Construct graphs only via public beam package combinators","Avoid hand-editing generated graph structures","Pin SDK versions in teams sharing pipeline code"],"tags":["go","apache-beam","graph","unsupported-input-kind"],"backgroundTag":"unsupported-operation","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"}