{"record":{"id":"1c8990726a28077a","repo":"vitessio/vitess","slug":"invalid-uuid-s-expected-condensed-32-hexadecima","errorCode":null,"errorMessage":"Invalid UUID: %s, expected condensed 32 hexadecimals","messagePattern":"Invalid UUID: (.+?), expected condensed 32 hexadecimals","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/schema/name.go","lineNumber":114,"sourceCode":"\treturn condensedUUIDRegexp.MatchString(uuid)\n}\n\n// generateGCTableName creates an internal table name, based on desired hint and time, and with optional preset UUID.\n// If uuid is given, then it must be in condensed-UUID format. If empty, the function auto-generates a UUID.\nfunc GenerateInternalTableName(hint string, uuid string, t time.Time) (tableName string, err error) {\n\tif len(hint) != 3 {\n\t\treturn \"\", fmt.Errorf(\"Invalid hint: %s, expected 3 characters\", hint)\n\t}\n\tif uuid == \"\" {\n\t\tuuid, err = CreateUUIDWithDelimiter(\"\")\n\t} else {\n\t\tuuid = condenseUUID(uuid)\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif !isCondensedUUID(uuid) {\n\t\treturn \"\", fmt.Errorf(\"Invalid UUID: %s, expected condensed 32 hexadecimals\", uuid)\n\t}\n\ttimestamp := ToReadableTimestamp(t)\n\treturn fmt.Sprintf(\"_vt_%s_%s_%s_\", hint, uuid, timestamp), nil\n}\n\n// IsInternalOperationTableName answers 'true' when the given table name stands for an internal Vitess\n// table used for operations such as:\n// - Online DDL (gh-ost, pt-online-schema-change)\n// - Table GC (renamed before drop)\n// Apps such as VStreamer may choose to ignore such tables.\nfunc IsInternalOperationTableName(tableName string) bool {\n\tif internalTableNameRegexp.MatchString(tableName) {\n\t\treturn true\n\t}\n\tif IsGCTableName(tableName) {\n\t\treturn true\n\t}\n\tif IsOnlineDDLTableName(tableName) {","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/schema/name.go#L96-L132","documentation":"GenerateInternalTableName validates that the UUID component is in condensed form: 32 hexadecimal characters with delimiters removed (isCondensedUUID). This guarantees deterministic, parseable internal table names. A non-condensed UUID (with hyphens, wrong length, or non-hex) is rejected.","triggerScenarios":"Passing a non-empty uuid argument to GenerateInternalTableName that is not condensed, e.g. a hyphenated standard UUID \"6ba7b810-9dad-...\" or a truncated string. Empty uuid is fine (auto-generated); anything else must pass isCondensedUUID.","commonSituations":"Passing a canonical hyphenated UUID (or one from google/uuid) directly; UUIDs stored with braces or uppercase hex; reusing a UUID from another system with different formatting.","solutions":["Condense the UUID first: strip delimiters/hyphens so it is exactly 32 hex chars, or pass \"\" to auto-generate.","Use the package's condenseUUID semantics — remove '-' and verify 32 hex characters.","Validate with a regexp ^[0-9a-f]{32}$ before calling."],"exampleFix":"// before\nname, err := schema.GenerateInternalTableName(\"rdg\", u.String(), time.Now()) // hyphenated\n// after\ncondensed := strings.ReplaceAll(u.String(), \"-\", \"\")\nname, err := schema.GenerateInternalTableName(\"rdg\", condensed, time.Now())","handlingStrategy":"validation","validationCode":"var condensedRe = regexp.MustCompile(`^[0-9a-f]{32}$`)\nif !condensedRe.MatchString(uuid) {\n    uuid = strings.ReplaceAll(strings.ToLower(uuid), \"-\", \"\")\n}","typeGuard":"func isCondensedUUID(u string) bool {\n    if len(u) != 32 { return false }\n    for _, c := range u {\n        if !(c >= '0' && c <= '9' || c >= 'a' && c <= 'f') { return false }\n    }\n    return true\n}","tryCatchPattern":"name, err := schema.GenerateInternalTableName(hint, uuid, now)\nif err != nil {\n    return fmt.Errorf(\"internal table name generation failed: %w\", err)\n}","preventionTips":["Strip hyphens and lowercase before passing UUIDs in.","Pass \"\" to let Vitess auto-generate when you have no preset UUID.","Store condensed UUIDs to avoid repeated conversion."],"tags":["schema","naming","uuid","validation"],"backgroundTag":"invalid-uuid-format","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}