{"record":{"id":"8bf896143b1c8048","repo":"apache/beam","slug":"unexpected-type-kind-v","errorCode":null,"errorMessage":"unexpected type kind %v","messagePattern":"unexpected type kind (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/serialize.go","lineNumber":678,"sourceCode":"\n\tcase v1pb.Type_SPECIAL:\n\t\tret, err := decodeSpecial(t.Special)\n\t\tif err != nil {\n\t\t\twrapped := errors.Wrap(err, \"bad element\")\n\t\t\treturn nil, errors.WithContextf(wrapped, \"decoding type %v\", t)\n\t\t}\n\t\treturn ret, nil\n\n\tcase v1pb.Type_EXTERNAL:\n\t\tret, ok := runtime.LookupType(t.ExternalKey)\n\t\tif !ok {\n\t\t\terr := errors.Errorf(\"external key not found %v\", t.ExternalKey)\n\t\t\treturn nil, errors.WithContextf(err, \"decoding type %v\", t)\n\t\t}\n\t\treturn ret, nil\n\n\tdefault:\n\t\terr := errors.Errorf(\"unexpected type kind %v\", t.Kind)\n\t\treturn nil, errors.WithContextf(err, \"failed to decode type %v\", t)\n\t}\n}\n\nfunc decodeSpecial(s v1pb.Type_Special) (reflect.Type, error) {\n\tswitch s {\n\tcase v1pb.Type_ERROR:\n\t\treturn reflectx.Error, nil\n\tcase v1pb.Type_CONTEXT:\n\t\treturn reflectx.Context, nil\n\tcase v1pb.Type_TYPE:\n\t\treturn reflectx.Type, nil\n\n\tcase v1pb.Type_EVENTTIME:\n\t\treturn typex.EventTimeType, nil\n\tcase v1pb.Type_WINDOW:\n\t\treturn typex.WindowType, nil\n\tcase v1pb.Type_BUNDLEFINALIZATION:","sourceCodeStart":660,"sourceCodeEnd":696,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/serialize.go#L660-L696","documentation":"decodeType received a v1pb.Type whose Kind field does not match any known Type_* enum case (primitive, slice, map, chan, pointer, special, external). This indicates a malformed or forward-incompatible type proto.","triggerScenarios":"Decoding a pipeline proto with an unrecognized Type.Kind value — typically from a newer Beam version that introduced a new kind, or a corrupted/truncated proto where Kind holds garbage.","commonSituations":"Version skew between encoder (newer Beam) and decoder (older Beam); manually crafted or corrupted pipeline JSON; wire format changes.","solutions":["Upgrade the Beam Go SDK used for decoding to match (or exceed) the encoding version","Re-serialize the pipeline with the version that will consume it","Inspect the proto's Type.Kind value and confirm it is a valid v1pb.Type_Kind","If upgrading isn't possible, avoid emitting the new type kind (e.g., use registered external types)"],"exampleFix":"// before: old SDK decoding new-format graph\ngraphx.DecodeGraph(data) // 'unexpected type kind 12'\n\n// after\ngo get github.com/apache/beam/sdks/go@latest // then rebuild the worker","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := graphx.DecodeGraph(data, &p); err != nil {\n    if strings.Contains(err.Error(), \"unexpected type kind\") {\n        return fmt.Errorf(\"graph encoded by incompatible Beam version; upgrade decoder: %w\", err)\n    }\n    return err\n}","preventionTips":["Pin the same Beam SDK version across job submitter, runner, and worker images","Avoid mixing pipeline-serialization formats across versions","Re-encode graphs after upgrading any component"],"tags":["beam","go","serialization","protobuf","version-skew"],"backgroundTag":"unsupported-enum-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"}