{"record":{"id":"978cc203d377f5b4","repo":"weaviate/weaviate","slug":"empty-uuid","errorCode":null,"errorMessage":"empty uuid","messagePattern":"empty uuid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/objects/merge.go","lineNumber":220,"sourceCode":"\t\tif errors.As(err, &ErrDirtyReadOfDeletedObject{}) || errors.As(err, &ErrDirtyWriteOfDeletedObject{}) {\n\t\t\tm.logger.WithError(err).Debugf(\"object %s/%s not found, possibly due to replication consistency races\", cls, id)\n\t\t\treturn &Error{\"not found\", StatusNotFound, err}\n\t\t}\n\t\treturn &Error{\"repo.merge\", StatusInternalServerError, err}\n\t}\n\n\treturn nil\n}\n\nfunc (m *Manager) validateInputs(updates *models.Object) error {\n\tif updates == nil {\n\t\treturn fmt.Errorf(\"empty updates\")\n\t}\n\tif updates.Class == \"\" {\n\t\treturn fmt.Errorf(\"empty class\")\n\t}\n\tif updates.ID == \"\" {\n\t\treturn fmt.Errorf(\"empty uuid\")\n\t}\n\treturn nil\n}\n\nfunc (m *Manager) mergeObjectSchemaAndVectorize(ctx context.Context, prevPropsSch models.PropertySchema,\n\tnextProps map[string]interface{}, prevVec, nextVec []float32, prevVecs models.Vectors, nextVecs models.Vectors,\n\tid strfmt.UUID, class *models.Class,\n) (*models.Object, error) {\n\tvar mergedProps map[string]interface{}\n\n\tvector := nextVec\n\tvectors := nextVecs\n\tif prevPropsSch == nil {\n\t\tmergedProps = nextProps\n\t} else {\n\t\tprevProps, ok := prevPropsSch.(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"expected previous schema to be map, but got %#v\", prevPropsSch)","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/objects/merge.go#L202-L238","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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\""],"exampleFix":"// before\nupdates := &models.Object{Class: \"Article\", Properties: props}\n\n// after\nupdates := &models.Object{Class: \"Article\", ID: strfmt.UUID(\"1c9cd584-88fe-5050-8c58-1cb2cfd61e93\"), Properties: props}","handlingStrategy":"validation","validationCode":"if updates.ID == \"\" {\n    return errors.New(\"merge updates must include the object uuid\")\n}\nif _, err := uuid.Parse(updates.ID.String()); err != nil {\n    return fmt.Errorf(\"invalid uuid: %w\", err)\n}","typeGuard":"func idSet(o *models.Object) bool { return o != nil && o.ID != \"\" }","tryCatchPattern":"if err != nil {\n    var e *objects.Error\n    if errors.As(err, &e) && strings.Contains(e.Error(), \"empty uuid\") {\n        // fetch the object first to obtain its id, then retry\n    }\n}","preventionTips":["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"],"tags":["go","validation","uuid","http-patch"],"backgroundTag":"missing-required-argument","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"}