{"record":{"id":"42df04798039858c","repo":"apache/beam","slug":"no-type-registered-s","errorCode":null,"errorMessage":"No type registered %s","messagePattern":"No type registered (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/io/datastoreio/datastore.go","lineNumber":243,"sourceCode":"\tclient, err := s.newClientFunc(ctx, s.Project)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer client.Close()\n\n\t// deserialize Query\n\tvar k string\n\tv(&k)\n\tq := BoundedQuery{}\n\terr = json.Unmarshal([]byte(k), &q)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// lookup type\n\tt, ok := runtime.LookupType(s.Type)\n\tif !ok {\n\t\treturn errors.Errorf(\"No type registered %s\", s.Type)\n\t}\n\n\t// Translate BoundedQuery to datastore.Query\n\tdq := datastore.NewQuery(s.Kind)\n\tif q.Start != nil {\n\t\tdq = dq.Filter(\"__key__ >=\", q.Start)\n\t}\n\tif q.End != nil {\n\t\tdq = dq.Filter(\"__key__ <\", q.End)\n\t}\n\n\t// Run Query\n\titer := client.Run(ctx, dq)\n\tfor {\n\t\tval := reflect.New(t).Interface() // val : *T\n\t\tif _, err := iter.Next(val); err != nil {\n\t\t\tif err == iterator.Done {\n\t\t\t\tbreak","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/io/datastoreio/datastore.go#L225-L261","documentation":"datastoreio serializes entities using Beam's coder registration: each element must carry a registered Go type so it can be encoded/decoded as a datastore property. ProcessElement calls runtime.LookupType(s.Type) with the type name recorded in the sink payload, and throws this error when that name isn't in the global type registry. This usually means the type was never registered via reflect.TypeOf(T{}).Name() registration or the name string is stale/wrong.","triggerScenarios":"Writing entities with datastoreio.Write when the element's registered type name does not match what's in the registry — e.g. the type name embedded in the payload refers to a type from a different binary/version, the registration call was removed, or the struct was renamed/refactored between pipeline submission and worker execution.","commonSituations":"Renaming a Go struct after building the pipeline so stored/serialized type names no longer resolve; running workers with a different binary version than the one that registered the types; forgetting to keep the init()-time type registration in the worker binary; using custom types not registered with Beam's reflection registry.","solutions":["Verify the type name stored in the payload matches the currently compiled struct and re-register it (via beam's reflection registration, e.g. in init())","Rebuild/redeploy the worker so the binary contains the same type names as the pipeline that wrote the data","If the struct was renamed, migrate existing datastore payloads to the new type name or add a registration alias","Check for version skew between pipeline submission and worker container images"],"exampleFix":"// before\n// type was renamed but registration removed\nfunc init() { /* nothing */ }\n// after\ntype UserEntity struct{ ... }\nfunc init() {\n    beam.RegisterType(reflect.TypeOf((*UserEntity)(nil)).Elem())\n}","handlingStrategy":"try-catch","validationCode":"func isTypeRegistered(t reflect.Type) bool {\n    _, ok := runtime.LookupType(t.Name())\n    return ok\n}","typeGuard":null,"tryCatchPattern":"if err := datastoreio.Write(scope, store, entity); err != nil {\n    if strings.Contains(err.Error(), \"No type registered\") {\n        log.Fatalf(\"type not registered: ensure beam.RegisterType is called in init(): %v\", err)\n    }\n    return err\n}","preventionTips":["Register every datastore entity type with the Beam reflection registry in init()","Rebuild workers after renaming or refactoring entity structs","Keep pipeline submission and worker images on the same code version","Add a startup check that all entity types resolve via runtime.LookupType"],"tags":["go","datastore","type-registry","serialization"],"backgroundTag":"class-not-found","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"}