weaviate/weaviate · error
invalid uuid array value: %s
Error message
invalid uuid array value: %s
What it means
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.
Source
Thrown at usecases/objects/validation/properties_validation.go:762
return nil, fmt.Errorf("invalid date array value: %s", val)
}
data[i] = dval
}
return data, nil
}
func uuidArrayVal(val interface{}) ([]uuid.UUID, error) {
typed, ok := val.([]interface{})
if !ok {
return nil, fmt.Errorf("not a uuid array, but %T", val)
}
data := make([]uuid.UUID, len(typed))
for i := range typed {
uval, err := uuidVal(typed[i])
if err != nil {
return nil, fmt.Errorf("invalid uuid array value: %s", val)
}
data[i] = uval
}
return data, nil
}
func ParseUUIDArray(in any) ([]uuid.UUID, error) {
var err error
if parsed, ok := in.([]uuid.UUID); ok {
return parsed, nil
}
asSlice, ok := in.([]any)
if !ok {
return nil, fmt.Errorf("not a slice type: %T", in)
}View on GitHub (pinned to 75aa4b6d11)
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
Example fix
// before
{"refProperty": ["12345"]}
// after
{"refProperty": ["1c9cd1f4-1234-4abc-9def-56789abcdef0"]} Defensive patterns
Strategy: validation
Validate before calling
func allUUIDs(v []interface{}) bool {
re := 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}$`)
for _, e := range v {
s, ok := e.(string)
if !ok || !re.MatchString(s) { return false }
}
return true
} Type guard
func toUUIDStrings(v []interface{}) ([]string, int) {
out := make([]string, 0, len(v)); bad := -1
for i, e := range v {
if s, ok := e.(string); ok { out = append(out, s) } else { return nil, i }
}
return out, bad
} Try / catch
if err != nil && strings.Contains(err.Error(), "invalid uuid array value") {
log.Printf("bad uuid array payload: %s", err.Error()) // message contains the whole array
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- not a uuid array, but %T
- invalid uuid array property '%s' on class '%s': %w
- the JSON number '%v' could not be converted to a float
- not a slice type: %T
- array element neither uuid.UUID nor str, but: %T
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/54352565d9dee8f7.
Report an issue: GitHub.