{"record":{"id":"de5a070250fd7e97","repo":"apache/beam","slug":"want-all-values-to-be-iterables-v","errorCode":null,"errorMessage":"want all values to be iterables: %v","messagePattern":"want all values to be iterables: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/translate.go","lineNumber":154,"sourceCode":"\t\tif len(in) < 2 {\n\t\t\treturn // Somehow there's only a single value, so we're done. (Defense against generic KVs)\n\t\t}\n\t\t// It's an iterator, so we can assume it's a GBK, due to previous pre-conditions.\n\t\tif sig.Param[in[1]].Kind == funcx.FnIter {\n\t\t\tu.Coder = convertToCoGBK(u.Coder)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc convertToCoGBK(oc *coder.Coder) *coder.Coder {\n\tocnw := coder.SkipW(oc)\n\t// Validate that all values from the coder are iterables.\n\tcomps := make([]*coder.Coder, 0, len(ocnw.Components))\n\tcomps = append(comps, ocnw.Components[0])\n\tfor _, c := range ocnw.Components[1:] {\n\t\tif c.Kind != coder.Iterable {\n\t\t\tpanic(fmt.Sprintf(\"want all values to be iterables: %v\", oc))\n\t\t}\n\t\tcomps = append(comps, c.Components[0])\n\t}\n\treturn coder.NewW(coder.NewCoGBK(comps), oc.Window)\n}\n\ntype builder struct {\n\tdesc   *fnpb.ProcessBundleDescriptor\n\tcoders *graphx.CoderUnmarshaller\n\n\tprev map[string]int      // PCollectionID -> #incoming\n\tsucc map[string][]linkID // PCollectionID -> []linkID\n\n\twindowing map[string]*window.WindowingStrategy\n\tnodes     map[string]*PCollection // PCollectionID -> Node (cache)\n\tlinks     map[linkID]Node         // linkID -> Node (cache)\n\n\tunits       []Unit // result","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/translate.go#L136-L172","documentation":"convertToCoGBK rewrites a CoGBK-style data source coder into a CoGBK coder, requiring every value component after the key to be an Iterable coder. If any value component's kind is not coder.Iterable, the function panics, since the CoGBK conversion cannot represent non-iterable values.","triggerScenarios":"A CoGBK output coder whose value side is a scalar or list/other composite instead of Iterable; graph translation from a runner port where the coder was inferred incorrectly; mayFixDataSourceCoder handing a coder that was already converted.","commonSituations":"Cross-language pipelines where the other SDK encodes GBK values differently; custom coder registration that mislabels a kind; version mismatches between runner and SDK coder representations.","solutions":["Inspect the coder in the panic message (%v) and confirm which component is not Iterable","Ensure upstream GBK outputs produce Iterable values (use beam.ParDo + beam.GroupByKey rather than hand-built coders)","Check custom translation/coder override code for incorrect NewCoGBK construction","Update the Go SDK — older versions had coder inference bugs around CoGBK sources"],"exampleFix":"// before\nc := coder.NewCoGBK([]*coder.Coder{kCoder, vScalarCoder}) // value not iterable\n// after\nc := coder.NewW(coder.NewCoGBK([]*coder.Coder{kCoder, coder.NewIter(vCoder)}), window)","handlingStrategy":"validation","validationCode":"for _, comp := range coder.SkipW(oc).Components[1:] {\n    if comp.Kind != coder.Iterable {\n        return fmt.Errorf(\"CoGBK value %v is not Iterable\", comp)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Let beam.GroupByKey construct CoGBK coders instead of hand-building them","Verify coder kinds after cross-language expansion","Keep the Go SDK current — coder inference bugs get fixed over time","Inspect pipeline coder dumps when mixing runners"],"tags":["go","apache-beam","coder","cogbk"],"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"}