weaviate/weaviate · error
empty uuid
Error message
empty uuid
What it means
validateInputs rejects merge updates whose ID field is empty. The UUID identifies which stored object to patch; without it the merge target is undefined, so the manager fails fast before any lookup. This runs after the nil and class checks in the same validation chain.
Source
Thrown at usecases/objects/merge.go:220
if errors.As(err, &ErrDirtyReadOfDeletedObject{}) || errors.As(err, &ErrDirtyWriteOfDeletedObject{}) {
m.logger.WithError(err).Debugf("object %s/%s not found, possibly due to replication consistency races", cls, id)
return &Error{"not found", StatusNotFound, err}
}
return &Error{"repo.merge", StatusInternalServerError, err}
}
return nil
}
func (m *Manager) validateInputs(updates *models.Object) error {
if updates == nil {
return fmt.Errorf("empty updates")
}
if updates.Class == "" {
return fmt.Errorf("empty class")
}
if updates.ID == "" {
return fmt.Errorf("empty uuid")
}
return nil
}
func (m *Manager) mergeObjectSchemaAndVectorize(ctx context.Context, prevPropsSch models.PropertySchema,
nextProps map[string]interface{}, prevVec, nextVec []float32, prevVecs models.Vectors, nextVecs models.Vectors,
id strfmt.UUID, class *models.Class,
) (*models.Object, error) {
var mergedProps map[string]interface{}
vector := nextVec
vectors := nextVecs
if prevPropsSch == nil {
mergedProps = nextProps
} else {
prevProps, ok := prevPropsSch.(map[string]interface{})
if !ok {
return nil, fmt.Errorf("expected previous schema to be map, but got %#v", prevPropsSch)View on GitHub (pinned to 75aa4b6d11)
Solutions
- Set "id": "<uuid>" in the PATCH body (or put the uuid in the URL for the classed route)
- Generate a valid UUID (strfmt.UUID) before constructing the update
- In Go, assign updates.ID = strfmt.UUID("...") prior to MergeObject
- Confirm the client SDK serializes the id field under the correct JSON key "id"
Example fix
// before
updates := &models.Object{Class: "Article", Properties: props}
// after
updates := &models.Object{Class: "Article", ID: strfmt.UUID("1c9cd584-88fe-5050-8c58-1cb2cfd61e93"), Properties: props} Defensive patterns
Strategy: validation
Validate before calling
if updates.ID == "" {
return errors.New("merge updates must include the object uuid")
}
if _, err := uuid.Parse(updates.ID.String()); err != nil {
return fmt.Errorf("invalid uuid: %w", err)
} Type guard
func idSet(o *models.Object) bool { return o != nil && o.ID != "" } Try / catch
if err != nil {
var e *objects.Error
if errors.As(err, &e) && strings.Contains(e.Error(), "empty uuid") {
// fetch the object first to obtain its id, then retry
}
} Prevention
- Keep the id with each update item in batch loops
- Use strfmt.UUID typed fields so empty values are visible
- Verify SDK field mapping keeps the "id" JSON key
When it happens
Trigger: PATCH body (or models.Object passed to MergeObject) where "id" is absent or empty string; calling the deprecated classless/object-id-less variants programmatically without setting input.ID.
Common situations: Batch-merge scripts that forget to copy the id per item; Go code with models.Object{Class: "Article"} only; client deserialization that maps the server's "id" to a differently named field, leaving it empty.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- parse uuid %q: %w
- invalid cref URI: %dnd path segment must be uuid, but got '%
- invalid cref URI: 2nd path segment must be uuid, but got '%s
- empty updates
- empty class
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/978cc203d377f5b4.
Report an issue: GitHub.