{"record":{"id":"ada198ecbf779adc","repo":"weaviate/weaviate","slug":"byte-cache-not-available","errorCode":null,"errorMessage":"byte cache not available","messagePattern":"byte cache not available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/vector/flat/quantizer.go","lineNumber":410,"sourceCode":"\t\tid = end\n\t}\n\treturn nil\n}\n\n// GetUint64 gets a uint64 vector from the cache\nfunc (c *Cache) GetUint64(ctx context.Context, id uint64) ([]uint64, error) {\n\tif c.dataType == Uint64Quantizer {\n\t\treturn c.uint64Cache.Get(ctx, id)\n\t}\n\treturn nil, fmt.Errorf(\"uint64 cache not available\")\n}\n\n// GetBytes gets a byte vector from the cache\nfunc (c *Cache) GetBytes(ctx context.Context, id uint64) ([]byte, error) {\n\tif c.dataType == ByteQuantizer {\n\t\treturn c.byteCache.Get(ctx, id)\n\t}\n\treturn nil, fmt.Errorf(\"byte cache not available\")\n}\n\n// LockAll locks all cache operations\nfunc (c *Cache) LockAll() {\n\tif c.dataType == Uint64Quantizer {\n\t\tc.uint64Cache.LockAll()\n\t}\n\tif c.dataType == ByteQuantizer {\n\t\tc.byteCache.LockAll()\n\t}\n}\n\n// UnlockAll unlocks all cache operations\nfunc (c *Cache) UnlockAll() {\n\tif c.dataType == Uint64Quantizer {\n\t\tc.uint64Cache.UnlockAll()\n\t}\n\tif c.dataType == ByteQuantizer {","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/vector/flat/quantizer.go#L392-L428","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nvecs, err := cache.GetBytes(ctx, id)\n// after\nif cache.DataType() == ByteQuantizer {\n    vecs, err = cache.GetBytes(ctx, id)\n} else {\n    vecsU64, err = cache.GetUint64(ctx, id)\n}","handlingStrategy":"type-guard","validationCode":"if c.DataType() != ByteQuantizer {\n    return nil, fmt.Errorf(\"cache is not byte-typed\")\n}","typeGuard":"func isByteCache(c *Cache) bool { return c.DataType() == ByteQuantizer }","tryCatchPattern":"vecs, err := c.GetBytes(ctx, id)\nif err != nil && strings.Contains(err.Error(), \"cache not available\") {\n    vecsU, uerr := c.GetUint64(ctx, id) // fallback to uint64 path\n}","preventionTips":["Align cache dataType with quantizer configuration","Check DataType() before GetBytes/GetUint64","Add regression tests for binary vs byte quantized shards"],"tags":["go","vector-index","cache"],"backgroundTag":"unsupported-vector-type","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"}