weaviate/weaviate · error

node %v not found

Error message

node %v not found

What it means

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.

Source

Thrown at adapters/repos/db/vector/flat/index.go:1357

		} else {
			// For RQ-1 bit, use NewDistancer to get 5-bit query quantization for better accuracy
			// This matches HNSW behavior where queries use higher precision than data vectors
			if index.compressionType == CompressionRQ1 && index.quantizer.Type() == Uint64Quantizer {
				// Create a distancer that uses 5-bit query quantization
				distancer := index.quantizer.(*BinaryRotationalQuantizerWrapper).NewDistancer(queryVector)
				distFunc = func(nodeID uint64) (float32, error) {
					// the window guard only makes sense on a complete cache,
					// where an id beyond it cannot exist; on an incomplete
					// cache, Get below falls back to disk
					if cacheLen := index.cache.Len(); index.cachePrefilled.Load() && int32(nodeID) > cacheLen {
						return -1, fmt.Errorf("node %v is larger than the cache size %v", nodeID, cacheLen)
					}
					vec, err := index.cache.uint64Cache.Get(context.Background(), nodeID)
					if err != nil {
						return 0, err
					}
					if len(vec) == 0 {
						return -1, fmt.Errorf("node %v not found", nodeID)
					}
					return distancer.Distance(vec)
				}
			} else {
				// Pre-encode query vector once for performance (for other quantizers)
				var queryVecEncodeUint64 []uint64
				var queryVecEncodeBytes []byte

				if index.quantizer.Type() == Uint64Quantizer {
					queryVecEncodeUint64 = index.quantizer.EncodeUint64(queryVector)
				} else if index.quantizer.Type() == ByteQuantizer {
					queryVecEncodeBytes = index.quantizer.EncodeBytes(queryVector)
				}

				distFunc = func(nodeID uint64) (float32, error) {
					// the window guard only makes sense on a complete cache,
					// where an id beyond it cannot exist; on an incomplete
					// cache, Get below falls back to disk

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Rebuild the quantized cache (restart the node or drop the shard's cache) so it is repopulated from stored vectors.
  2. Run consistency checks / repair on the shard; if the underlying vectors are missing too, re-import the collection or restore from a healthy backup.
  3. Retry the search; if it's transient during cache fill, wait until `cachePrefilled` is complete before querying.

Example fix

// fired inside distFunc:
vec, err := index.cache.uint64Cache.Get(context.Background(), nodeID)
if err != nil { return 0, err }
if len(vec) == 0 { return -1, fmt.Errorf("node %v not found", nodeID) }
// fix: ensure cache is fully prefilled before serving queries and rebuild it from disk if entries are empty
Defensive patterns

Strategy: fallback

Validate before calling

vec, err := cache.Get(id)
if err == nil && len(vec) == 0 {
	return fmt.Errorf("cache entry for %d is empty; rebuild cache", id)
}

Type guard

func hasVecData(b []byte) bool { return len(b) > 0 }

Try / catch

res, err := idx.SearchByVector(v, k, allow)
if strings.Contains(err.Error(), "not found") {
	rebuildQuantizedCache(idx)
	res, err = idx.SearchByVector(v, k, allow)
}

Prevention

When it happens

Trigger: 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.

Common situations: Shard crash mid-cache-write leaving empty entries; corrupted cache segment; a backup restore that recreated the graph but not the cache contents.

Related errors


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/131520a0647f5dd7. Report an issue: GitHub.