{"record":{"id":"f1921aef0786b42f","repo":"apache/beam","slug":"bad-iterable-stream-v","errorCode":null,"errorMessage":"bad iterable/stream: %+v","messagePattern":"bad iterable/stream: %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/dataflow.go","lineNumber":333,"sourceCode":"\t\tif len(c.Components) != 2 {\n\t\t\treturn nil, errors.Errorf(\"bad windowed value: %+v\", c)\n\t\t}\n\n\t\telm, err := DecodeCoderRef(c.Components[0])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tw, err := decodeWindowCoder(c.Components[1])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tt := typex.New(typex.WindowedValueType, elm.T)\n\n\t\treturn &coder.Coder{Kind: coder.WindowedValue, T: t, Components: []*coder.Coder{elm}, Window: w}, nil\n\n\tcase streamType:\n\t\tif len(c.Components) != 1 {\n\t\t\treturn nil, errors.Errorf(\"bad iterable/stream: %+v\", c)\n\t\t}\n\n\t\tinner, err := DecodeCoderRef(c.Components[0])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tt := typex.New(reflect.SliceOf(inner.T.Type()), inner.T)\n\t\treturn &coder.Coder{Kind: coder.Iterable, T: t, Components: []*coder.Coder{inner}}, nil\n\n\tcase rowType:\n\t\tsubC := c.Components[0]\n\t\tschm := &pipepb.Schema{}\n\t\tif err := protox.DecodeBase64(subC.Type, schm); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tt, err := schema.ToType(schm)\n\t\tif err != nil {","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/dataflow.go#L315-L351","documentation":"DecodeCoderRef converts stream-type refs (iterables) back into coders. A stream ref must have exactly one component (the element coder); any other count is malformed, so decoding fails with the ref printed in the message.","triggerScenarios":"Decoding a CoderRef with Type streamType whose Components has length != 1 — during deserialization of a pipeline graph or job description containing a corrupted or foreign-encoded iterable coder.","commonSituations":"Pipeline artifacts produced by different SDK versions; custom graph rewriters duplicating element components; truncated or hand-edited proto/json pipelines; GBK output graphs decoded with mismatched tooling.","solutions":["Regenerate the pipeline artifact from the original pipeline so stream coders are re-encoded correctly.","Match SDK versions between the encoder and decoder of the pipeline graph.","Check custom graph-mutation passes for edits to stream/iterable coder component lists.","Inspect the printed CoderRef to trace which transform's coder is malformed."],"exampleFix":"// before\nref := &graphx.CoderRef{Type: graphx.Stream, Components: nil}\nc, err := graphx.DecodeCoderRef(ref)\n\n// after\nref := &graphx.CoderRef{Type: graphx.Stream, Components: []*graphx.CoderRef{elemRef}}\nc, err := graphx.DecodeCoderRef(ref)","handlingStrategy":"try-catch","validationCode":"func validStreamRef(r *graphx.CoderRef) bool {\n\treturn r != nil && r.Type == graphx.Stream && len(r.Components) == 1\n}","typeGuard":"func isStreamRef(r *graphx.CoderRef) bool { return r != nil && r.Type == graphx.Stream && len(r.Components) == 1 }","tryCatchPattern":"c, err := graphx.DecodeCoderRef(ref)\nif err != nil {\n\tif strings.Contains(err.Error(), \"bad iterable/stream\") {\n\t\treturn nil, fmt.Errorf(\"stream ref needs exactly 1 element component %v: %w\", ref, err)\n\t}\n\treturn nil, err\n}","preventionTips":["Round-trip test iterable coders in unit tests","Never mutate CoderRef component slices in graph tooling","Re-encode pipelines after any SDK version change"],"tags":["go","beam","iterable","coder-deserialization"],"backgroundTag":"unexpected-response-shape","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"}