{"record":{"id":"0d5abd6ff87c82d5","repo":"apache/beam","slug":"windowedvalue-coder-with-more-than-2-components-s","errorCode":null,"errorMessage":"WindowedValue coder with more than 2 components: %s","messagePattern":"WindowedValue coder with more than 2 components: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"sdks/go/pkg/beam/runners/prism/internal/coders.go","lineNumber":362,"sourceCode":"\t\t\tfor i := int32(0); i < l; i++ {\n\t\t\t\ted(r)\n\t\t\t}\n\t\t}\n\tcase urns.CoderKV:\n\t\tccids := c.GetComponentCoderIds()\n\t\tif len(ccids) != 2 {\n\t\t\tpanic(fmt.Sprintf(\"KV coder with more than 2 components: %s\", prototext.Format(c)))\n\t\t}\n\t\tkd := pullDecoderNoAlloc(coders[ccids[0]], coders)\n\t\tvd := pullDecoderNoAlloc(coders[ccids[1]], coders)\n\t\treturn func(r io.Reader) {\n\t\t\tkd(r)\n\t\t\tvd(r)\n\t\t}\n\tcase urns.CoderWindowedValue:\n\t\tccids := c.GetComponentCoderIds()\n\t\tif len(ccids) != 2 {\n\t\t\tpanic(fmt.Sprintf(\"WindowedValue coder with more than 2 components: %s\", prototext.Format(c)))\n\t\t}\n\t\ted := pullDecoderNoAlloc(coders[ccids[0]], coders)\n\t\twd := pullDecoderNoAlloc(coders[ccids[1]], coders)\n\t\treturn func(r io.Reader) {\n\t\t\ted(r)\n\t\t\twd(r)\n\t\t}\n\tcase urns.CoderShardedKey:\n\t\tccids := c.GetComponentCoderIds()\n\t\tif len(ccids) != 1 {\n\t\t\tpanic(fmt.Sprintf(\"ShardedKey coder must have only 1 component: %s\", prototext.Format(c)))\n\t\t}\n\t\tkd := pullDecoderNoAlloc(coders[ccids[0]], coders)\n\t\treturn func(r io.Reader) {\n\t\t\tl, _ := coder.DecodeVarInt(r)\n\t\t\tioutilx.ReadN(r, int(l))\n\t\t\tkd(r)\n\t\t}","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/coders.go#L344-L380","documentation":"A WindowedValue coder must have exactly two components (the value coder and the window coder). pullDecoderNoAlloc panics when the component list has a different length, indicating a malformed coder graph from the SDK.","triggerScenarios":"pullDecoderNoAlloc sees urn beam:coders:windowed_value:v1 with GetComponentCoderIds() length != 2, e.g. the window component coder ID missing or duplicated, usually from a harness/SDK coder mismatch.","commonSituations":"Custom windowing code in an SDK emitting a windowed-value coder with wrong components; version skew between SDK and prism; cross-language pipelines where window coders aren't propagated correctly.","solutions":["Examine the printed coder proto and confirm component_coder_ids has exactly 2 entries","Ensure the SDK side uses standard windowed-value coder construction (beam.WindowInto paths)","Align SDK and runner versions to the same Beam release","Minimize the pipeline to find the transform emitting the malformed coder"],"exampleFix":"// before\nwc := pipepb.Coder_Urn_WINDOWED_VALUE // components built ad hoc\n// after\nwvCoder := beam.CreateWindowedValueCoder(valueCoder, intervalWindowCoder) // exactly 2 components","handlingStrategy":"validation","validationCode":"if len(wvCoder.GetComponentCoderIds()) != 2 { return fmt.Errorf(\"WindowedValue coder must have exactly 2 components, got %d\", len(wvCoder.GetComponentCoderIds())) }","typeGuard":null,"tryCatchPattern":"defer func() { if r := recover(); r != nil { log.Errorf(\"windowed-value coder panicked: %v\", r) } }()","preventionTips":["Use standard WindowInto/windowing paths that pair value+window coders correctly","Avoid custom window coder assembly unless required","Match SDK and runner versions"],"tags":["go","beam","prism","coder","windowing","panic"],"backgroundTag":"internal-invariant-violation","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"}