{"record":{"id":"ceec9e4a95a9bf65","repo":"apache/beam","slug":"iterable-coder-must-have-only-one-component-s","errorCode":null,"errorMessage":"Iterable coder must have only one component: %s","messagePattern":"Iterable coder must have only one component: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/coders.go","lineNumber":339,"sourceCode":"\t\t\t}\n\t\t\ted(r)\n\t\t}\n\tcase urns.CoderVarInt:\n\t\treturn func(r io.Reader) {\n\t\t\tcoder.DecodeVarInt(r)\n\t\t}\n\tcase urns.CoderBool:\n\t\treturn func(r io.Reader) {\n\t\t\tcoder.DecodeBool(r)\n\t\t}\n\tcase urns.CoderDouble:\n\t\treturn func(r io.Reader) {\n\t\t\tcoder.DecodeDouble(r)\n\t\t}\n\tcase urns.CoderIterable:\n\t\tccids := c.GetComponentCoderIds()\n\t\tif len(ccids) != 1 {\n\t\t\tpanic(fmt.Sprintf(\"Iterable coder must have only one component: %s\", prototext.Format(c)))\n\t\t}\n\t\ted := pullDecoderNoAlloc(coders[ccids[0]], coders)\n\t\treturn func(r io.Reader) {\n\t\t\tl, _ := coder.DecodeInt32(r)\n\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)","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/coders.go#L321-L357","documentation":"The Iterable coder must wrap exactly one component coder. prism's recursive pullDecoderNoAlloc enforces this invariant and panics when an beam:coder:iterable:v1 coder has zero or multiple component coder IDs.","triggerScenarios":"A submitted pipeline contains an Iterable coder whose GetComponentCoderIds length is not 1; the panic occurs while prism materializes decoders for the affected PCollection.","commonSituations":"Malformed graphs from SDK/runner version mismatches, custom coders built by hand, or third-party pipeline generators writing invalid component lists.","solutions":["Correct the Iterable coder to declare exactly one component coder ID","Regenerate the pipeline with a matching Beam SDK version","Inspect the prototext coder dump in the panic message to find the bad component list","Check custom coder construction code that assembles Iterable coders"],"exampleFix":"// before\n&pipepb.Coder{Spec: iterableUrn, ComponentCoderIds: []string{\"c0\", \"c1\"}},\n// after\n&pipepb.Coder{Spec: iterableUrn, ComponentCoderIds: []string{\"c0\"}},","handlingStrategy":"validation","validationCode":"if c.GetSpec().GetUrn() == \"beam:coder:iterable:v1\" && len(c.GetComponentCoderIds()) != 1 {\n    return fmt.Errorf(\"invalid iterable coder: %v\", c)\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil && strings.Contains(fmt.Sprint(r), \"Iterable coder must have only one component\") {\n        err = fmt.Errorf(\"malformed iterable coder in pipeline: %v\", r)\n    }\n}()","preventionTips":["Wrap exactly one component in every Iterable coder","Keep SDK and runner versions aligned","Validate coder graphs before submission in custom pipeline builders","Use the prototext dump in the panic to locate the offending coder"],"tags":["prism","coders","validation"],"backgroundTag":"schema-validation-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"}