{"record":{"id":"7b48a6d0a2671036","repo":"weaviate/weaviate","slug":"update-vector-index-7b48a6","errorCode":null,"errorMessage":"update vector index","messagePattern":"update vector index","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/shard_write_put.go","lineNumber":80,"sourceCode":"\t// https://github.com/weaviate/weaviate/issues/3949\n\tif status.skipUpsert {\n\t\treturn nil\n\t}\n\n\tfor targetVector, vector := range object.Vectors {\n\t\tif err := s.updateVectorIndex(ctx, vector, status, targetVector); err != nil {\n\t\t\treturn errors.Wrapf(err, \"update vector index for target vector %s\", targetVector)\n\t\t}\n\t}\n\tfor targetVector, multiVector := range object.MultiVectors {\n\t\tif err := s.updateMultiVectorIndex(ctx, multiVector, status, targetVector); err != nil {\n\t\t\treturn errors.Wrapf(err, \"update multi vector index for target vector %s\", targetVector)\n\t\t}\n\t}\n\n\tif s.hasLegacyVectorIndex() {\n\t\tif err := s.updateVectorIndex(ctx, object.Vector, status, \"\"); err != nil {\n\t\t\treturn errors.Wrap(err, \"update vector index\")\n\t\t}\n\t}\n\n\tif err := s.updatePropertySpecificIndices(ctx, object, status); err != nil {\n\t\treturn errors.Wrap(err, \"update property-specific indices\")\n\t}\n\n\tif err := s.store.WriteWALs(); err != nil {\n\t\treturn errors.Wrap(err, \"flush all buffered WALs\")\n\t}\n\n\tif err := s.GetPropertyLengthTracker().Flush(); err != nil {\n\t\treturn errors.Wrap(err, \"flush prop length tracker to disk\")\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/shard_write_put.go#L62-L98","documentation":"Wraps failure of the legacy (unnamed, pre-named-vectors) single-vector index update in putOne. Only fired when s.hasLegacyVectorIndex() is true, i.e. classes created before named vectors that still use the top-level 'vector' field. Means the object row is stored but not searchable by the legacy vector index.","triggerScenarios":"PUT on a legacy-indexed class where updateVectorInVectorIndex fails: queue lookup fails for the unnamed target (\"\"), old docID delete fails on update, vector dimension validation fails, or HNSW insert/WAL flush errors.","commonSituations":"Migrating from single-vector to named-vector schema while legacy index still active, vector dimension mismatch after changing vectorizer, HNSW commit log issues, disk full.","solutions":["Read the wrapped inner error ('vector index not found for' means the legacy index queue is missing — an internal inconsistency; restart/rebuild shard)","Verify vector dimensions match the configured vectorizer","Check HNSW disk/WAL health for the shard","Retry the PUT to re-run the index update","If migrating schemas, ensure legacy and named vectors are mutually consistent"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate legacy vector dims against vectorizer before send\nif len(obj.Vector) > 0 && len(obj.Vector) != legacyDims {\n    return fmt.Errorf(\"legacy vector dim mismatch\")\n}","typeGuard":null,"tryCatchPattern":"if err := put.Do(ctx); err != nil {\n    if strings.Contains(err.Error(), \"update vector index\") {\n        // retry; check HNSW health and dimension config\n    }\n}","preventionTips":["Avoid mixing legacy single-vector and named-vector fields in one write","Re-check vectorizer dimensions after module upgrades","Monitor HNSW commit log disk usage"],"tags":["go","vector-index","hnsw","legacy"],"backgroundTag":"vector-index-update-failed","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"}