{"record":{"id":"932fdd8afadbda2c","repo":"apache/beam","slug":"unexpected-inbound-type-v","errorCode":null,"errorMessage":"unexpected inbound type: %v","messagePattern":"unexpected inbound type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/bind.go","lineNumber":302,"sourceCode":"\t\t\t\t\t\treturn nil, kind, errors.Errorf(\"values of %v cannot bind to %v\", t, args[i])\n\t\t\t\t\t}\n\t\t\t\t\tcomponents = append(components, typex.New(trimmed[0]))\n\n\t\t\t\tcase funcx.FnReIter:\n\t\t\t\t\tvalues, _ := funcx.UnfoldReIter(args[i].T)\n\t\t\t\t\ttrimmed := trimIllegal(values)\n\t\t\t\t\tif len(trimmed) != 1 {\n\t\t\t\t\t\treturn nil, kind, errors.Errorf(\"values of %v cannot bind to %v\", t, args[i])\n\t\t\t\t\t}\n\t\t\t\t\tcomponents = append(components, typex.New(trimmed[0]))\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, kind, errors.Errorf(\"values of %v cannot bind to %v\", t, args[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tother = typex.NewCoGBK(components...)\n\n\t\tdefault:\n\t\t\treturn nil, kind, errors.Errorf(\"unexpected inbound type: %v\", t.Type())\n\t\t}\n\n\tdefault:\n\t\treturn nil, kind, errors.Errorf(\"unexpected inbound class: %v\", t.Class())\n\t}\n\n\tif !typex.IsStructurallyAssignable(t, other) {\n\t\treturn nil, kind, errors.Errorf(\"%v is not assignable to %v\", t, other)\n\t}\n\treturn other, kind, nil\n}\n\nfunc inboundArity(t typex.FullType, isMain bool) (int, error) {\n\tif t.Class() == typex.Composite {\n\t\tswitch t.Type() {\n\t\tcase typex.KVType:\n\t\t\tif isMain {\n\t\t\t\treturn 2, nil","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/bind.go#L284-L320","documentation":"tryBindInbound throws this when a composite inbound type (like KV, CoGBK, or Windowed) has a component type not supported by the binder's composite switch. Only a known set of composite component types (Bool, Bytes, etc. per the switch) can be bound. The error reports the raw inbound type so the mismatch is visible.","triggerScenarios":"Building a side input or main input whose composite FullType contains a component type that is not in the binder's supported composite-type list, e.g. a KV of custom structs where the binder expects primitive/registered kinds.","commonSituations":"Side inputs built from PCollections of unregistered custom types; windowed side inputs with unusual value types; mixing SDK versions where a type kind was added later.","solutions":["Ensure composite components use supported/registered types (primitives, registered coders).","Register a coder for the custom component type with beam.RegisterCoder before binding.","Decode/encode the composite into a supported shape (e.g. map values to primitives) before using it as a side input.","Check t.Type() in the message to identify the offending component and replace it."],"exampleFix":"// before: KV<MyKey, MyUnregisteredStruct> side input\n// after: register coder\ntype MyStruct struct{ A int }\nbeam.RegisterCoder(reflect.TypeOf(MyStruct{}), encodeMyStruct, decodeMyStruct)","handlingStrategy":"validation","validationCode":"// Go: verify composite components are registered/supported before binding\nfor _, c := range t.Components() {\n    if reflect.New(c).Interface() == nil {\n        return fmt.Errorf(\"component %v must be a registered, non-interface type\", c)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Register coders for all custom types with beam.RegisterCoder.","Prefer primitives or registered structs in KV/CoGBK composites.","Test side inputs locally before running at scale."],"tags":["go","type-binding","composite-type"],"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"}