{"record":{"id":"e916c350f2bb4398","repo":"apache/beam","slug":"error-reconciling-type-v","errorCode":null,"errorMessage":"error reconciling type %v","messagePattern":"error reconciling type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go","lineNumber":135,"sourceCode":"\tvar ut reflect.Type\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tdeferedErr = errors.Errorf(\"panicked: %v\", r)\n\t\t\tdeferedErr = errors.WithContextf(deferedErr, \"reconciling schema registration for type %v\", ut)\n\t\t}\n\t}()\n\tfor _, ut := range r.toReconcile {\n\t\tcheck := func(ut reflect.Type) bool {\n\t\t\treturn coder.LookupCustomCoder(ut) != nil\n\t\t}\n\t\t// We could have either a pointer or non pointer here,\n\t\t// so we strip pointerness and then check both.\n\t\tvT := reflectx.SkipPtr(ut)\n\t\tif check(vT) || check(reflect.PtrTo(vT)) {\n\t\t\tcontinue\n\t\t}\n\t\tif err := r.registerType(ut, map[reflect.Type]struct{}{}); err != nil {\n\t\t\treturn errors.Wrapf(err, \"error reconciling type %v\", ut)\n\t\t}\n\t}\n\tr.toReconcile = nil\n\treturn nil\n}\n\nfunc implements(ut, ifacet reflect.Type) bool {\n\tif ut.Implements(ifacet) {\n\t\treturn true\n\t}\n\tswitch ut.Kind() {\n\tcase reflect.Ptr:\n\t\tt := ut.Elem()\n\t\tif t.Implements(ifacet) {\n\t\t\treturn true\n\t\t}\n\t\treturn implements(t, ifacet)\n\tcase reflect.Struct:","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go#L117-L153","documentation":"During reconcileRegistrations, each queued type is registered into the schema registry. If registerType returns an error for a given type, this error wraps it with the offending type name. It means a queued type could not be converted into a schema.","triggerScenarios":"Calling schema.Registered, schema.FromType, or schema.ToType after RegisterType queued a type whose registerType call fails (bad embedded fields, unregistered logical types, unsupported kinds).","commonSituations":"First actual use of a lazily-registered type in a schema operation surfaces the deferred registration failure; types with unsupported shapes (interfaces, funcs) mixed with required schema conversion.","solutions":["Read the wrapped cause to find the failing type and fix the specific registration problem (embedded unexported pointer, unsupported kind).","Register an explicit custom coder for the type so reconciliation is skipped.","Restructure the type to a schema-friendly shape (no embedded unexported pointers, serializable fields only)."],"exampleFix":"// before: type with embedded pointer to unexported type\ntype outer struct { *inner }\n// after\nschema.RegisterCustomTypeProvider(...) // or restructure:\ntype outer struct { Inner *exportedInner }","handlingStrategy":"try-catch","validationCode":"// Pre-check the type registers cleanly\nif _, err := schema.ToType(reflect.TypeOf(myType{})); err != nil {\n    return fmt.Errorf(\"type %v not schema-compatible: %w\", reflect.TypeOf(myType{}), err)\n}","typeGuard":null,"tryCatchPattern":"v, err := schema.FromType(t)\nif err != nil {\n    if strings.Contains(err.Error(), \"error reconciling type\") {\n        // register a custom coder fallback for this type\n    }\n}","preventionTips":["Test schema.ToType on all pipeline types in unit tests","Avoid embedded unexported pointers in pipeline data types","Register custom coders for types that fail schema conversion"],"tags":["go","beam","schema","registration"],"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-20T03:17:13.778Z"}