{"record":{"id":"81864d6a5f4a1554","repo":"apache/beam","slug":"infercoder-unknown-container-kind-v","errorCode":null,"errorMessage":"inferCoder: unknown container kind %v","messagePattern":"inferCoder: unknown container kind (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/coder.go","lineNumber":184,"sourceCode":"}\n\nfunc inferCoder(t FullType) (*coder.Coder, error) {\n\tswitch t.Class() {\n\tcase typex.Container:\n\t\tswitch t.Type() {\n\t\tcase reflectx.ByteSlice:\n\t\t\treturn &coder.Coder{Kind: coder.Bytes, T: t}, nil\n\t\t}\n\t\tswitch t.Type().Kind() {\n\t\tcase reflect.Slice:\n\t\t\tc, err := inferCoder(t.Components()[0])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn &coder.Coder{Kind: coder.Iterable, T: t, Components: []*coder.Coder{c}}, nil\n\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"inferCoder: unknown container kind %v\", t))\n\t\t}\n\tcase typex.Concrete:\n\t\tswitch t.Type() {\n\t\tcase reflectx.Int64:\n\t\t\t// use the beam varint coder.\n\t\t\treturn &coder.Coder{Kind: coder.VarInt, T: t}, nil\n\t\tcase reflectx.Int, reflectx.Int8, reflectx.Int16, reflectx.Int32:\n\t\t\tc, err := coderx.NewVarIntZ(t.Type())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn coder.CoderFrom(c), nil\n\t\tcase reflectx.Uint, reflectx.Uint8, reflectx.Uint16, reflectx.Uint32, reflectx.Uint64:\n\t\t\tc, err := coderx.NewVarUintZ(t.Type())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn coder.CoderFrom(c), nil","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/coder.go#L166-L202","documentation":"Inside beam's inferCoder, container FullTypes are dispatched by kind (CoGBK, Windowed, etc.). If a container kind is not one of the handled cases, the code panics with 'inferCoder: unknown container kind %v', naming the unrecognized type. This indicates the type falls outside the SDK's supported coding schemes.","triggerScenarios":"Inferring coders for a container FullType with an unhandled kind — typically new/odd typex container kinds introduced by other SDK versions, custom typex constructions, or nested unsupported containers.","commonSituations":"Cross-language or cross-version pipelines where the type graph includes container kinds this Go SDK version doesn't know; manually constructing typex container types not produced by standard builders.","solutions":["Upgrade the Apache Beam Go SDK to a version that supports the container kind in question","Avoid manually constructing unusual typex container types; use standard builders (typex.New, CoGBK, Windowed wrappers)","Register a custom coder for the element type and construct the coder explicitly instead of relying on inference","Check for SDK version mismatch between pipeline submitter and runner"],"exampleFix":"// before\nc := beam.NewCoder(customContainerType) // panics in default branch\n// after\n// construct coder explicitly with known kind:\nc := beam.Coder{Coder: &coder.Coder{Kind: coder.Iterable, T: t, Components: []*coder.Coder{elemCoder}}}","handlingStrategy":"try-catch","validationCode":"switch t.Class() {\ncase typex.Container:\n\t// verify kind is one handled: CoGBK, Windowed, etc. before calling NewCoder\n}","typeGuard":null,"tryCatchPattern":"func safeInfer(t typex.FullType) (c *coder.Coder, err error) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\terr = fmt.Errorf(\"unsupported container kind %v\", t)\n\t\t}\n\t}()\n\t// invoke inference path\n\treturn nil, nil\n}","preventionTips":["Upgrade the Go SDK when pipelines use newer container kinds","Use standard typex builders instead of manual type construction","Pin matching SDK versions across pipeline authoring and execution environments"],"tags":["go","apache-beam","panic","coder","type-inference"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}