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

  1. Validate every array element is a canonical UUID string before sending (e.g. with uuid.Parse / RFC 4122 regex)
  2. Log the full array from the message and bisect to find the offending element
  3. Normalize ids from external systems to UUID format first
  4. 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

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


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/54352565d9dee8f7. Report an issue: GitHub.