{"record":{"id":"c4234c141320ac25","repo":"apache/beam","slug":"type-is-of-kind-v","errorCode":null,"errorMessage":"type is of kind %v","messagePattern":"type is of kind (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go","lineNumber":252,"sourceCode":"\t\t\treturn errors.Wrapf(err, \"unable to convert LogicalType[%v] using provider for %v\", t, lti)\n\t\t}\n\t\tif st == nil {\n\t\t\tcontinue\n\t\t}\n\t\tr.RegisterLogicalType(ToLogicalType(t.String(), t, st))\n\t\tr.addToMaps(st, t)\n\t\treturn nil\n\t}\n\n\tswitch t.Kind() {\n\tcase reflect.Map:\n\t\tif err := r.registerType(t.Key(), seen); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfallthrough\n\tcase reflect.Array, reflect.Slice, reflect.Ptr:\n\t\tif err := r.registerType(t.Elem(), seen); err != nil {\n\t\t\treturn errors.Wrapf(err, \"type is of kind %v\", t.Kind())\n\t\t}\n\t\treturn nil\n\tcase reflect.Interface, reflect.Func, reflect.Chan, reflect.Invalid, reflect.UnsafePointer, reflect.Uintptr:\n\t\t// Ignore these, as they can't be serialized.\n\t\treturn nil\n\tcase reflect.Complex64, reflect.Complex128:\n\t\t// TODO(BEAM-9615): Support complex number types.\n\t\treturn nil\n\tcase reflect.Struct: // What we expect here.\n\tdefault:\n\t\trt, ok := reflectKindToTypeMap[t.Kind()]\n\t\tif !ok {\n\t\t\t// Kind is not listed, meaning it's an unlisted somehow, which means either the map\n\t\t\t// is missing something, or the above switch cases are missing something.\n\t\t\treturn errors.Errorf(\"unlisted kind %v for type %v reached.\", t.Kind(), t)\n\t\t}\n\t\tif t != rt {\n\t\t\t// It's only a logical type if it's not a built in primitive type, which is returned by the map.","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go#L234-L270","documentation":"registerType recursively registers composite types (maps, arrays, slices, pointers). When registering a nested component (key or element) fails, the error is wrapped with \"type is of kind %v\" to indicate which parent kind the recursion came from.","triggerScenarios":"registerType on a map/array/slice/pointer type whose Key() or Elem() type itself fails registration (e.g. element with unsupported kind or bad embedded field).","commonSituations":"Registering deeply nested types like []*unexportedEmbedded or map[string]badType where the failure is in the child; long wrap chains in the error message show the path of the offending nested type.","solutions":["Follow the wrapped error chain to the innermost cause and fix the child type that actually failed.","Register a custom coder for the offending nested type.","Simplify or restructure the nested type to schema-supported shapes."],"exampleFix":"// before: failing nested element\ntype Wrapper struct { Items []*badElem }\n// after\nschema.RegisterCustomCoder(...) // or fix badElem's registration problem","handlingStrategy":"try-catch","validationCode":"// Validate nested element types before registration\nif bad := firstUnsupported(t.Elem()); bad != nil {\n    return fmt.Errorf(\"nested type %v unsupported\", bad)\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"type is of kind\") {\n        // inspect wrapped cause; fix the innermost type\n    }\n}","preventionTips":["Keep composite types built from schema-supported primitives","Test deep type registration before pipeline submission","Use custom coders for composite types containing unsupported leaves"],"tags":["go","beam","schema","recursion","reflection"],"backgroundTag":"schema-validation-failed","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"}