{"record":{"id":"83102205a302fceb","repo":"apache/beam","slug":"unable-to-generate-schema-uuid-for-s-wrote-out-d-bytes-want","errorCode":null,"errorMessage":"unable to generate schema uuid for %s, wrote out %d bytes, want %d: err %v","messagePattern":"unable to generate schema uuid for (.+?), wrote out (.+?) bytes, want (.+?): err (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go","lineNumber":83,"sourceCode":"// the default schema registry.\nfunc Registered(ut reflect.Type) bool {\n\treturn defaultRegistry.Registered(ut)\n}\n\n// RegisterType converts the type to it's schema representation, and converts it back to\n// a synthetic type so we can map from the synthetic type back to the user type.\n// Recursively registers other named struct types in any component parts.\nfunc RegisterType(ut reflect.Type) {\n\tdefaultRegistry.RegisterType(ut)\n}\n\n// getUUID generates a UUID using the string form of the type name.\nfunc getUUID(ut reflect.Type) string {\n\t// String produces non-empty output for pointer and slice types.\n\ttypename := ut.String()\n\thasher := fnv.New128a()\n\tif n, err := hasher.Write([]byte(typename)); err != nil || n != len(typename) {\n\t\tpanic(fmt.Sprintf(\"unable to generate schema uuid for %s, wrote out %d bytes, want %d: err %v\", typename, n, len(typename), err))\n\t}\n\tid, err := uuid.NewRandomFromReader(bytes.NewBuffer(hasher.Sum(nil)))\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"unable to genereate schema uuid for type %s: %v\", typename, err))\n\t}\n\treturn id.String()\n}\n\n// Registered returns whether the given type has been registered with\n// the schema package.\nfunc (r *Registry) Registered(ut reflect.Type) bool {\n\tr.reconcileRegistrations()\n\tr.rwmu.RLock()\n\tdefer r.rwmu.RUnlock()\n\t_, ok := r.syntheticToUser[ut]\n\treturn ok\n}\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go#L65-L101","documentation":"getUUID derives a stable schema UUID by hashing the type's string name with FNV-128a. It panics if hasher.Write reports an error or writes a different number of bytes than the typename length — a defensive check that should be practically unreachable in Go.","triggerScenarios":"Any call path through fromType or structToSchema that computes a UUID; the panic fires only if fnv hash Write fails or short-writes, which essentially indicates memory/allocation failure or a corrupted hasher.","commonSituations":"Systemic memory pressure or OOM conditions during schema registration; this is nearly always an internal invariant failure rather than user error.","solutions":["Retry the operation; the failure is transient at worst","Check system memory availability","Report to Beam if reproducible, since FNV Write is not expected to fail"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"defer func() { if r := recover(); r != nil { err = fmt.Errorf(\"schema uuid generation failed: %v\", r) } }()","preventionTips":["Ensure adequate memory when registering many types","Retry on transient failures","Report reproducible cases to the Beam project"],"tags":["go","apache-beam","schema","uuid","panic"],"backgroundTag":"internal-invariant-violation","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"}