{"record":{"id":"c3166cf74b4ffc3d","repo":"apache/beam","slug":"key-of-v-cannot-bind-to-v","errorCode":null,"errorMessage":"key of %v cannot bind to %v","messagePattern":"key of (.+?) cannot bind to (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/bind.go","lineNumber":229,"sourceCode":"\t\t\t\t\treturn nil, kind, errors.Errorf(\"%v cannot bind to %v\", t, args[0])\n\t\t\t\t}\n\n\t\t\t\tkind = ReIter\n\t\t\t\tother = typex.New(trimmed[0])\n\n\t\t\tcase funcx.FnMultiMap:\n\t\t\t\treturn nil, kind, errors.Errorf(\"input to MultiMap side input must be KV, got %v\", t)\n\n\t\t\tdefault:\n\t\t\t\treturn nil, kind, errors.Errorf(\"unexpected param kind: %v\", arg)\n\t\t\t}\n\t\t}\n\tcase typex.Composite:\n\t\tswitch t.Type() {\n\t\tcase typex.KVType:\n\t\t\tif isMain {\n\t\t\t\tif args[0].Kind != funcx.FnValue {\n\t\t\t\t\treturn nil, kind, errors.Errorf(\"key of %v cannot bind to %v\", t, args[0])\n\t\t\t\t}\n\t\t\t\tif args[1].Kind != funcx.FnValue {\n\t\t\t\t\treturn nil, kind, errors.Errorf(\"value of %v cannot bind to %v\", t, args[1])\n\t\t\t\t}\n\t\t\t\tother = typex.NewKV(typex.New(args[0].T), typex.New(args[1].T))\n\t\t\t} else {\n\t\t\t\tswitch args[0].Kind {\n\t\t\t\tcase funcx.FnIter:\n\t\t\t\t\tvalues, _ := funcx.UnfoldIter(args[0].T)\n\t\t\t\t\ttrimmed := trimIllegal(values)\n\t\t\t\t\tif len(trimmed) != 2 {\n\t\t\t\t\t\treturn nil, kind, errors.Errorf(\"%v cannot bind to %v\", t, args[0])\n\t\t\t\t\t}\n\n\t\t\t\t\tkind = Iter\n\t\t\t\t\tother = typex.NewKV(typex.New(trimmed[0]), typex.New(trimmed[1]))\n\n\t\t\t\tcase funcx.FnReIter:","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/bind.go#L211-L247","documentation":"Error returned by tryBindInbound when binding a KV-typed main input: the first component (the key) of the collection type cannot bind to the DoFn's first parameter because that parameter is not of kind funcx.FnValue. For a main KV input both key and value parameters must be plain values, so a mismatched key parameter aborts binding.","triggerScenarios":"Thrown at sdks/go/pkg/beam/core/graph/bind.go:229 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Adjust the DoFn signature so the first (key) parameter is a plain value type matching the KV key","Or convert the input PCollection so its type matches the DoFn parameters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}