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
- Verify the quantizer/cache type first and call GetUint64 when dataType == Uint64Quantizer
- Rebuild/initialize the cache with dataType == ByteQuantizer if byte vectors are the intended storage
- 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
- Align cache dataType with quantizer configuration
- Check DataType() before GetBytes/GetUint64
- Add regression tests for binary vs byte quantized shards
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
- uint64 cache not available
- segments cannot be 0 nor negative
- segments should be an integer divisor of dimensions
- invalid encoder type
- invalid encoder distribution
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/ada198ecbf779adc.
Report an issue: GitHub.