weaviate/weaviate · error
failed to get version for %d
Error message
failed to get version for %d
What it means
VersionStore.Get in the hfresh vector index reads a vector's version byte from the persistent LSMKV version bucket. This wrapped error is returned when the underlying bucket.Get call itself fails (I/O error, corrupted store, closed bucket, failed bucket acquisition path in wrapped form). It is distinct from ErrVectorNotFound, which is returned when the key simply has no stored version.
Source
Thrown at adapters/repos/db/vector/hfresh/version_map.go:285
func (v *VersionStore) key(vectorID uint64) []byte {
buf := make([]byte, len(versionMapBucketPrefix)+8)
copy(buf, versionMapBucketPrefix)
binary.LittleEndian.PutUint64(buf[len(versionMapBucketPrefix):], vectorID)
return buf
}
func (v *VersionStore) Get(ctx context.Context, vectorID uint64) (VectorVersion, error) {
key := v.key(vectorID)
bucket, release, err := v.bucket.acquire()
if err != nil {
return 0, err
}
defer release()
version, err := bucket.Get(key[:])
if err != nil {
return 0, errors.Wrapf(err, "failed to get version for %d", vectorID)
}
if len(version) == 0 {
return 0, ErrVectorNotFound
}
return VectorVersion(version[0]), nil
}
func (v *VersionStore) Set(ctx context.Context, vectorID uint64, version VectorVersion) error {
key := v.key(vectorID)
bucket, release, err := v.bucket.acquire()
if err != nil {
return err
}
defer release()
return bucket.Put(key[:], []byte{byte(version)})View on GitHub (pinned to 75aa4b6d11)
Solutions
- Check disk health and free space on the persistence data volume (dmesg, df).
- Verify the shard/collection was not deleted or closed while clients were reading; retry after shard is available.
- If the store is corrupted, restore the affected shard/collection from a backup or re-index the data.
- Check file permissions/ownership of the Weaviate data directory (PERSISTENCE_DATA_PATH).
Example fix
// caller: distinguish 'not found' from real read failure
version, err := store.Get(ctx, vectorID)
if err != nil {
if errors.Is(err, ErrVectorNotFound) {
// key absent — handle as missing, do not retry
return nil, errVectorMissing
}
// wrapped "failed to get version for %d" — storage-level, retry or alert
return nil, fmt.Errorf("version store read failed: %w", err)
} Defensive patterns
Strategy: try-catch
Type guard
// Go: classify via errors.Is against the sentinel
func isVectorNotFound(err error) bool { return errors.Is(err, ErrVectorNotFound) }
func isStorageFailure(err error) bool {
return err != nil && !isVectorNotFound(err)
} Try / catch
version, err := store.Get(ctx, vectorID)
if err != nil {
switch {
case errors.Is(err, ErrVectorNotFound):
// treat as absent vector
default:
// wrapped storage failure: retry with backoff / alert on persistence
return retryOrEscalate(err)
}
} Prevention
- Monitor disk health and free space on the persistence volume.
- Avoid deleting shards/collections while readers are active.
- Restore corrupted shards from backups instead of forcing reads.
- Run the node with correct ownership of PERSISTENCE_DATA_PATH.
When it happens
Trigger: Calling VersionStore.Get(ctx, vectorID) when the LSMKV bucket cannot be read: the bucket was acquired via v.bucket.acquire() successfully but bucket.Get(key[:]) fails due to disk I/O errors, a corrupted/unmounted store, a closed or shutting-down shard, or LSMKV internal read failures.
Common situations: Disk full or failing disk under the Weaviate persistence directory; shard being dropped or closed concurrently while a read is in flight; corrupted LSMKV segment files after an unclean shutdown; permission problems on the store directory after a container/volume migration.
Related errors
- resetDimensionsLSM: no bucket dimensions
- generate unique bucket name
- replace dimensions bucket
- cleanup quarantined %d segment(s) after exhausting the retry
- read pending/quarantine set after %d consecutive errors: %w
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/e218af52940394ea.
Report an issue: GitHub.