{"record":{"id":"eb6aec36b4d94642","repo":"apache/beam","slug":"could-not-unmarshal-kv-coder-value-component-w","errorCode":null,"errorMessage":"could not unmarshal kv coder value component: %w","messagePattern":"could not unmarshal kv coder value component: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/coder.go","lineNumber":223,"sourceCode":"\t\treturn coder.NewDouble(), nil\n\n\tcase urnStringCoder:\n\t\treturn coder.NewString(), nil\n\n\tcase urnKVCoder:\n\t\tif len(components) != 2 {\n\t\t\treturn nil, errors.Errorf(\"could not unmarshal KV coder from %v, want exactly 2 components but have %d\", c, len(components))\n\t\t}\n\n\t\tkey, err := b.Coder(components[0])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tid := components[1]\n\t\telm, err := b.peek(id)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"could not unmarshal kv coder value component: %w\", err)\n\t\t}\n\n\t\tswitch elm.GetSpec().GetUrn() {\n\t\tcase urnIterableCoder, urnStateBackedIterableCoder:\n\t\t\titerElmID := elm.GetComponentCoderIds()[0]\n\n\t\t\t// TODO(https://github.com/apache/beam/issues/18032): If CoGBK with > 1 input, handle as special GBK. We expect\n\t\t\t// it to be encoded as CoGBK<K,LP<CoGBKList<V,W,..>>>. Remove this handling once\n\t\t\t// CoGBK has a first-class representation.\n\n\t\t\t// If the value is an iterable, and a special CoGBK type, then expand it to the real\n\t\t\t// CoGBK signature, instead of the special type.\n\t\t\tif ids, ok := b.isCoGBKList(iterElmID); ok {\n\t\t\t\t// CoGBK<K,V,W,..>\n\n\t\t\t\tvalues, err := b.Coders(ids)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/coder.go#L205-L241","documentation":"While unmarshaling a KV coder's value component, makeCoder peeks at the value's coder proto to see if it is an Iterable-backed coder. If peeking the component (by ID) fails, the error is wrapped as \"could not unmarshal kv coder value component: %w\".","triggerScenarios":"makeCoder on a KV coder whose value component ID points to a coder that cannot be peeked/unmarshaled — missing coder definition, unresolvable nested component, or invalid spec.","commonSituations":"Pipeline protos where the KV value coder references an Iterable/StateBackedIterable coder that is absent or malformed; cross-version serialization mismatches around iterable coders.","solutions":["Read the wrapped cause to find which nested coder failed and why.","Ensure the value component's coder ID and any nested iterable component IDs exist in the coders map.","Re-serialize the pipeline with a matching SDK version if iterable coder payloads differ between versions.","Avoid hand-editing coder component IDs in saved pipeline protos."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"cd, err := um.Coder(id)\nif err != nil && strings.Contains(err.Error(), \"kv coder value component\") {\n    log.Printf(\"fix nested value coder: %v\", err)\n}","preventionTips":["Ensure iterable/StateBackedIterable value coders are registered in the proto.","Avoid hand-editing component coder IDs in serialized pipelines.","Keep producer and consumer SDK versions aligned for iterable coder changes."],"tags":["go","coder","kv","iterable"],"backgroundTag":"protobuf-unmarshal-failed","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"}