{"record":{"id":"69b0f13a1b4a2cc3","repo":"apache/beam","slug":"empty-type","errorCode":null,"errorMessage":"empty type","messagePattern":"empty type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/serialize.go","lineNumber":563,"sourceCode":"\tcase typex.VType:\n\t\treturn v1pb.Type_V, true\n\tcase typex.WType:\n\t\treturn v1pb.Type_W, true\n\tcase typex.XType:\n\t\treturn v1pb.Type_X, true\n\tcase typex.YType:\n\t\treturn v1pb.Type_Y, true\n\tcase typex.ZType:\n\t\treturn v1pb.Type_Z, true\n\n\tdefault:\n\t\treturn v1pb.Type_ILLEGAL, false\n\t}\n}\n\nfunc decodeType(t *v1pb.Type) (reflect.Type, error) {\n\tif t == nil {\n\t\terr := errors.New(\"empty type\")\n\t\treturn nil, errors.WithContextf(err, \"decoding type %v\", t)\n\t}\n\n\tswitch t.Kind {\n\tcase v1pb.Type_BOOL:\n\t\treturn reflectx.Bool, nil\n\tcase v1pb.Type_INT:\n\t\treturn reflectx.Int, nil\n\tcase v1pb.Type_INT8:\n\t\treturn reflectx.Int8, nil\n\tcase v1pb.Type_INT16:\n\t\treturn reflectx.Int16, nil\n\tcase v1pb.Type_INT32:\n\t\treturn reflectx.Int32, nil\n\tcase v1pb.Type_INT64:\n\t\treturn reflectx.Int64, nil\n\tcase v1pb.Type_UINT:\n\t\treturn reflectx.Uint, nil","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/serialize.go#L545-L581","documentation":"decodeType converts a v1pb.Type protobuf message into a reflect.Type during coder/graph deserialization. A nil *v1pb.Type carries no type information at all, so decodeType immediately fails with this error (context-wrapped) rather than guessing a type.","triggerScenarios":"Decoding a serialized graph/coder where a Type field in the protobuf is nil — e.g. decodeCustomCoder, decodeFn, decodeUserFn, or recursive decodeFullType/decodeType/decodeTypes walk hitting a missing Type submessage.","commonSituations":"Corrupted or truncated pipeline/coder protos; hand-built protobufs missing required Type fields; cross-version serialization bugs where a new optional type field is absent in old payloads.","solutions":["Ensure the marshaling side always populates the Type field before serializing.","Regenerate the serialized graph/coder with a matching Beam version.","Inspect the proto payload for the nil Type and fix it at the producer."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if t == nil { return errors.New(\"serialized graph contains nil Type\") }","typeGuard":"func hasType(t *v1pb.Type) bool { return t != nil && t.Kind != v1pb.Type_ILLEGAL }","tryCatchPattern":"rt, err := decodeType(pbType)\nif err != nil {\n    return fmt.Errorf(\"coder deserialization failed: %w\", err)\n}","preventionTips":["Always populate Type fields when building v1pb messages","Validate serialized pipelines/coders at write time","Keep serializer/deserializer Beam versions aligned"],"tags":["go","apache-beam","graphx","serialization","protobuf"],"backgroundTag":"null-argument","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"}