{"record":{"id":"131520a0647f5dd7","repo":"weaviate/weaviate","slug":"node-v-not-found","errorCode":null,"errorMessage":"node %v not found","messagePattern":"node (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/vector/flat/index.go","lineNumber":1357,"sourceCode":"\t\t} else {\n\t\t\t// For RQ-1 bit, use NewDistancer to get 5-bit query quantization for better accuracy\n\t\t\t// This matches HNSW behavior where queries use higher precision than data vectors\n\t\t\tif index.compressionType == CompressionRQ1 && index.quantizer.Type() == Uint64Quantizer {\n\t\t\t\t// Create a distancer that uses 5-bit query quantization\n\t\t\t\tdistancer := index.quantizer.(*BinaryRotationalQuantizerWrapper).NewDistancer(queryVector)\n\t\t\t\tdistFunc = func(nodeID uint64) (float32, error) {\n\t\t\t\t\t// the window guard only makes sense on a complete cache,\n\t\t\t\t\t// where an id beyond it cannot exist; on an incomplete\n\t\t\t\t\t// cache, Get below falls back to disk\n\t\t\t\t\tif cacheLen := index.cache.Len(); index.cachePrefilled.Load() && int32(nodeID) > cacheLen {\n\t\t\t\t\t\treturn -1, fmt.Errorf(\"node %v is larger than the cache size %v\", nodeID, cacheLen)\n\t\t\t\t\t}\n\t\t\t\t\tvec, err := index.cache.uint64Cache.Get(context.Background(), nodeID)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn 0, err\n\t\t\t\t\t}\n\t\t\t\t\tif len(vec) == 0 {\n\t\t\t\t\t\treturn -1, fmt.Errorf(\"node %v not found\", nodeID)\n\t\t\t\t\t}\n\t\t\t\t\treturn distancer.Distance(vec)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Pre-encode query vector once for performance (for other quantizers)\n\t\t\t\tvar queryVecEncodeUint64 []uint64\n\t\t\t\tvar queryVecEncodeBytes []byte\n\n\t\t\t\tif index.quantizer.Type() == Uint64Quantizer {\n\t\t\t\t\tqueryVecEncodeUint64 = index.quantizer.EncodeUint64(queryVector)\n\t\t\t\t} else if index.quantizer.Type() == ByteQuantizer {\n\t\t\t\t\tqueryVecEncodeBytes = index.quantizer.EncodeBytes(queryVector)\n\t\t\t\t}\n\n\t\t\t\tdistFunc = func(nodeID uint64) (float32, error) {\n\t\t\t\t\t// the window guard only makes sense on a complete cache,\n\t\t\t\t\t// where an id beyond it cannot exist; on an incomplete\n\t\t\t\t\t// cache, Get below falls back to disk","sourceCodeStart":1339,"sourceCodeEnd":1375,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/vector/flat/index.go#L1339-L1375","documentation":"In the BinaryRotationalQuantizer distancer, after the cache lookup of `nodeID` succeeds, the returned byte slice is empty — the cache has no vector data for that id. A zero-length cached entry is treated as 'id known but vector absent', so the distance function returns this error instead of computing a distance. It indicates the quantized cache is missing data for a referenced id.","triggerScenarios":"Quantized flat search over a binary-rotational cache where `index.cache.uint64Cache.Get` returns a nil/empty slice for a node id reached during traversal — e.g. an entry was evicted/never written, or a partially prefilled cache handed back an empty record instead of a miss.","commonSituations":"Shard crash mid-cache-write leaving empty entries; corrupted cache segment; a backup restore that recreated the graph but not the cache contents.","solutions":["Rebuild the quantized cache (restart the node or drop the shard's cache) so it is repopulated from stored vectors.","Run consistency checks / repair on the shard; if the underlying vectors are missing too, re-import the collection or restore from a healthy backup.","Retry the search; if it's transient during cache fill, wait until `cachePrefilled` is complete before querying."],"exampleFix":"// fired inside distFunc:\nvec, err := index.cache.uint64Cache.Get(context.Background(), nodeID)\nif err != nil { return 0, err }\nif len(vec) == 0 { return -1, fmt.Errorf(\"node %v not found\", nodeID) }\n// fix: ensure cache is fully prefilled before serving queries and rebuild it from disk if entries are empty","handlingStrategy":"fallback","validationCode":"vec, err := cache.Get(id)\nif err == nil && len(vec) == 0 {\n\treturn fmt.Errorf(\"cache entry for %d is empty; rebuild cache\", id)\n}","typeGuard":"func hasVecData(b []byte) bool { return len(b) > 0 }","tryCatchPattern":"res, err := idx.SearchByVector(v, k, allow)\nif strings.Contains(err.Error(), \"not found\") {\n\trebuildQuantizedCache(idx)\n\tres, err = idx.SearchByVector(v, k, allow)\n}","preventionTips":["Ensure the shard finishes cache prefill before serving traffic.","Back up cache and vector segments together to avoid torn restores.","Monitor disk health — torn writes leave empty cache entries."],"tags":["vector-index","quantization","cache","missing-data"],"backgroundTag":"cache-entry-missing","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"}