{"record":{"id":"54352565d9dee8f7","repo":"weaviate/weaviate","slug":"invalid-uuid-array-value-s","errorCode":null,"errorMessage":"invalid uuid array value: %s","messagePattern":"invalid uuid array value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/objects/validation/properties_validation.go","lineNumber":762,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\"invalid date array value: %s\", val)\n\t\t}\n\t\tdata[i] = dval\n\t}\n\n\treturn data, nil\n}\n\nfunc uuidArrayVal(val interface{}) ([]uuid.UUID, error) {\n\ttyped, ok := val.([]interface{})\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"not a uuid array, but %T\", val)\n\t}\n\n\tdata := make([]uuid.UUID, len(typed))\n\tfor i := range typed {\n\t\tuval, err := uuidVal(typed[i])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid uuid array value: %s\", val)\n\t\t}\n\t\tdata[i] = uval\n\t}\n\n\treturn data, nil\n}\n\nfunc ParseUUIDArray(in any) ([]uuid.UUID, error) {\n\tvar err error\n\n\tif parsed, ok := in.([]uuid.UUID); ok {\n\t\treturn parsed, nil\n\t}\n\n\tasSlice, ok := in.([]any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"not a slice type: %T\", in)\n\t}","sourceCodeStart":744,"sourceCodeEnd":780,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/objects/validation/properties_validation.go#L744-L780","documentation":"uuidArrayVal builds the []uuid.UUID result element-by-element via uuidVal; when any element cannot be interpreted as a UUID, this error is returned. Notably it formats the whole val (the array) rather than the offending element or the underlying uuidVal error, which makes it harder to pinpoint the bad position. It means at least one element of the array is not a valid UUID value.","triggerScenarios":"POST/PATCH /v1/objects where a uuid array property contains an element that fails uuidVal: a non-string element (number, bool, object, null), or a string that is not a parseable UUID (wrong length, missing dashes variant unsupported, empty string).","commonSituations":"Typos in manually written reference payloads; truncated UUIDs; passing integers or other id formats (e.g. numeric DB ids) into reference arrays; base64 or prefixed ids from another system.","solutions":["Validate every array element is a canonical UUID string before sending (e.g. with uuid.Parse / RFC 4122 regex)","Log the full array from the message and bisect to find the offending element","Normalize ids from external systems to UUID format first","If a nested error message is needed, note the inner uuidVal failure is swallowed; test elements individually"],"exampleFix":"// before\n{\"refProperty\": [\"12345\"]}\n// after\n{\"refProperty\": [\"1c9cd1f4-1234-4abc-9def-56789abcdef0\"]}","handlingStrategy":"validation","validationCode":"func allUUIDs(v []interface{}) bool {\n\tre := regexp.MustCompile(`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`)\n\tfor _, e := range v {\n\t\ts, ok := e.(string)\n\t\tif !ok || !re.MatchString(s) { return false }\n\t}\n\treturn true\n}","typeGuard":"func toUUIDStrings(v []interface{}) ([]string, int) {\n\tout := make([]string, 0, len(v)); bad := -1\n\tfor i, e := range v {\n\t\tif s, ok := e.(string); ok { out = append(out, s) } else { return nil, i }\n\t}\n\treturn out, bad\n}","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"invalid uuid array value\") {\n\tlog.Printf(\"bad uuid array payload: %s\", err.Error()) // message contains the whole array\n}","preventionTips":["Parse/normalize ids with uuid.Parse before inserting into payloads","Log full arrays on failure since the message includes the value, not the index","Reject nulls and non-strings in id arrays at serialization time","Use typed UUID wrappers in client code instead of raw strings"],"tags":["validation","uuid","json","weaviate"],"backgroundTag":"invalid-uuid-format","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}