{"record":{"id":"c3582efe5f0cb6e4","repo":"apache/beam","slug":"illegal-iter-type-v","errorCode":null,"errorMessage":"illegal iter type: %v","messagePattern":"illegal iter type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/input.go","lineNumber":122,"sourceCode":"\t// cur is the \"current\" stream, if any.\n\tcur Stream\n}\n\nfunc makeIter(t reflect.Type, s ReStream) ReusableInput {\n\tinputsMu.Lock()\n\tmaker, exists := inputs[t]\n\tinputsMu.Unlock()\n\n\tif exists {\n\t\treturn maker(s)\n\t}\n\n\t// If no specialized implementation is available, we use the (slower)\n\t// reflection-based one.\n\n\ttypes, ok := funcx.UnfoldIter(t)\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"illegal iter type: %v\", t))\n\t}\n\n\tret := &iterValue{types: types, s: s}\n\tret.fn = reflect.MakeFunc(t, ret.invoke).Interface()\n\treturn ret\n}\n\nfunc (v *iterValue) Init() error {\n\tcur, err := v.s.Open()\n\tif err != nil {\n\t\treturn err\n\t}\n\tv.cur = cur\n\treturn nil\n}\n\nfunc (v *iterValue) Value() any {\n\treturn v.fn","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/input.go#L104-L140","documentation":"makeIter adapts a ReStream into a reflection function value for side inputs / DoFn iterators. It only supports types that funcx.UnfoldIter can decompose into (element-type) iterator signatures; anything else — a non-function type or an unsupported signature — panics with the offending type.","triggerScenarios":"makeSideInput or invoke paths call makeIter with a type t for which UnfoldIter returns ok=false, e.g. the parameter type isn't func(T) bool / func(*T) bool shaped.","commonSituations":"Declaring a DoFn side-input parameter with a wrong type (slice, channel, or wrong function signature), graph/coder mismatch between pipeline submission and execution, or API misuse building custom inputs.","solutions":["Change the DoFn parameter to a supported iterator type: func(v T) bool or the beam counterparts funcx recognizes.","Verify the side input's element type matches the iterator's element type in the pipeline graph.","Guard construction by calling funcx.UnfoldIter yourself first and reporting a clear configuration error."],"exampleFix":"// before\nfunc (d *myFn) ProcessElement(s map[string]int, v string) { ... } // unsupported side input type\n// after\nfunc (d *myFn) ProcessElement(kv func(func(KV[string,int]) bool), v string) { ... }","handlingStrategy":"type-guard","validationCode":"if _, ok := funcx.UnfoldIter(t); !ok {\n\treturn fmt.Errorf(\"side input type %v is not a supported iterator\", t)\n}","typeGuard":"func usableIter(t reflect.Type) bool { _, ok := funcx.UnfoldIter(t); return ok }","tryCatchPattern":null,"preventionTips":["Declare DoFn iterator parameters as func(v T) bool style types funcx supports.","Ensure side-input element types in the graph match the DoFn parameter's element type.","Run a small smoke-test pipeline with the side input before deploying."],"tags":["go","panic","beam","side-input","reflection"],"backgroundTag":"invalid-argument-value","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"}