{"record":{"id":"86dfe83bfa502ec1","repo":"weaviate/weaviate","slug":"get-vector-of-docid-d","errorCode":null,"errorMessage":"get vector of docID %d","messagePattern":"get vector of docID (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/vector/hnsw/search.go","lineNumber":690,"sourceCode":"\t\tvec, err = h.TempVectorForIDWithViewThunk(ctx, nodeID, slice, view)\n\t} else {\n\t\tdocID, relativeID := h.cache.GetKeys(nodeID)\n\t\tvecs, err := h.TempMultiVectorForIDWithViewThunk(ctx, docID, slice, view)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t} else if len(vecs) <= int(relativeID) {\n\t\t\treturn 0, errors.Errorf(\"relativeID %d is out of bounds for docID %d\", relativeID, docID)\n\t\t}\n\t\tvec = vecs[relativeID]\n\t}\n\tif err != nil {\n\t\tvar e storobj.ErrNotFound\n\t\tif errors.As(err, &e) {\n\t\t\th.handleDeletedNode(nodeID, \"distanceFromBytesToFloatNodeWithView\")\n\t\t\treturn 0, err\n\t\t}\n\t\t// not a typed error, we can recover from, return with err\n\t\treturn 0, errors.Wrapf(err, \"get vector of docID %d\", nodeID)\n\t}\n\t// Normalize in-place since vec points to a pooled slice that will be\n\t// returned after this function. This avoids allocating a new slice\n\t// for every vector during rescoring.\n\th.normalizeVecInPlace(vec)\n\treturn concreteDistancer.DistanceToFloat(vec)\n}\n\nfunc (h *hnsw) distanceToFloatNode(distancer distancer.Distancer, nodeID uint64) (float32, error) {\n\tcandidateVec, err := h.vectorForID(context.Background(), nodeID)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tdist, err := distancer.Distance(candidateVec)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"calculate distance between candidate and query\")\n\t}","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/vector/hnsw/search.go#L672-L708","documentation":"While fetching a candidate's vector to compute its distance during rescoring, any error that is NOT a recoverable storobj.ErrNotFound is wrapped with 'get vector of docID %d'. Typed ErrNotFound (deleted nodes) are handled by tombstoning the node; this wrapper indicates a different storage-level failure retrieving the vector for that node. The nodeID in the message is the internal HNSW node/document id.","triggerScenarios":"distanceFromBytesToFloatNodeWithView: TempVectorForIDWithViewThunk (or the multivector thunk) returns a non-ErrNotFound error for nodeID while a compressed index is being rescored — e.g. disk I/O error, checksum failure, or corrupt vector bytes in the LSM store.","commonSituations":"Disk failures or a crashed write leaving a torn vector record; running with a corrupted persistent store after an unclean shutdown; store files deleted or permission problems at the filesystem level.","solutions":["Read the wrapped root cause in the logs and fix the storage layer (disk full, permissions, I/O errors).","Restore from backup and re-index the shard whose store is corrupted.","Run a consistency check / compaction of the affected shard's LSM store.","If a specific object is corrupt, delete and re-push that object to regenerate its vector."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"res, err := client.GraphQL().Get().Do(ctx)\nif err != nil && strings.Contains(err.Error(), \"get vector of docID\") {\n    // treat as storage corruption: alert, check disk/store, consider backup restore\n}","preventionTips":["Use clean shutdowns; avoid killing the process during writes","Monitor filesystem health (space, IO errors) on data volumes","Schedule periodic backups and verify restore procedures"],"tags":["go","storage","lsmkv","hnsw","rescoring"],"backgroundTag":"vector-store-corruption","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"}