weaviate/weaviate · error

byte cache not available

Error message

byte cache not available

What it means

Symmetric counterpart of the uint64 case: Cache.GetBytes only works when dataType is ByteQuantizer. When the cache was created for a uint64 quantizer there is no byte cache backing it, so the call fails with this error. A genuine cache miss still returns no error; this error means the cache kind itself does not match.

Source

Thrown at adapters/repos/db/vector/flat/quantizer.go:410

		id = end
	}
	return nil
}

// GetUint64 gets a uint64 vector from the cache
func (c *Cache) GetUint64(ctx context.Context, id uint64) ([]uint64, error) {
	if c.dataType == Uint64Quantizer {
		return c.uint64Cache.Get(ctx, id)
	}
	return nil, fmt.Errorf("uint64 cache not available")
}

// GetBytes gets a byte vector from the cache
func (c *Cache) GetBytes(ctx context.Context, id uint64) ([]byte, error) {
	if c.dataType == ByteQuantizer {
		return c.byteCache.Get(ctx, id)
	}
	return nil, fmt.Errorf("byte cache not available")
}

// LockAll locks all cache operations
func (c *Cache) LockAll() {
	if c.dataType == Uint64Quantizer {
		c.uint64Cache.LockAll()
	}
	if c.dataType == ByteQuantizer {
		c.byteCache.LockAll()
	}
}

// UnlockAll unlocks all cache operations
func (c *Cache) UnlockAll() {
	if c.dataType == Uint64Quantizer {
		c.uint64Cache.UnlockAll()
	}
	if c.dataType == ByteQuantizer {

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Verify the quantizer/cache type first and call GetUint64 when dataType == Uint64Quantizer
  2. Rebuild/initialize the cache with dataType == ByteQuantizer if byte vectors are the intended storage
  3. Align the collection's quantizer configuration with the code path performing the lookup

Example fix

// before
vecs, err := cache.GetBytes(ctx, id)
// after
if cache.DataType() == ByteQuantizer {
    vecs, err = cache.GetBytes(ctx, id)
} else {
    vecsU64, err = cache.GetUint64(ctx, id)
}
Defensive patterns

Strategy: type-guard

Validate before calling

if c.DataType() != ByteQuantizer {
    return nil, fmt.Errorf("cache is not byte-typed")
}

Type guard

func isByteCache(c *Cache) bool { return c.DataType() == ByteQuantizer }

Try / catch

vecs, err := c.GetBytes(ctx, id)
if err != nil && strings.Contains(err.Error(), "cache not available") {
    vecsU, uerr := c.GetUint64(ctx, id) // fallback to uint64 path
}

Prevention

When it happens

Trigger: Calling cache.GetBytes on a cache constructed for a uint64/binary quantizer, e.g. a binary rotational quantized index whose search path requests byte compressed vectors.

Common situations: Index reconfigured between binary and byte quantization while generic search code still calls the old getter; shared flat-index code assuming byte quantization for all collections.

Related errors


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