weaviate/weaviate · error
read vector weights length
Error message
read vector weights length
What it means
Returned when reading the uint32 'vector weights length' field fails because fewer than 4 bytes remain in the buffer at the cursor. Vector weights are optional per-dimension weights stored after the meta section in the wire format.
Source
Thrown at entities/storobj/storage_object.go:1606
return errors.Wrap(err, "read schema length")
}
schema, err := rw.ReadBytesFromBufferChecked(uint64(schemaLength))
if err != nil {
return errors.Wrap(err, "read schema")
}
metaLength, err := rw.ReadUint32Checked()
if err != nil {
return errors.Wrap(err, "read meta length")
}
meta, err := rw.ReadBytesFromBufferChecked(uint64(metaLength))
if err != nil {
return errors.Wrap(err, "read meta")
}
vectorWeightsLength, err := rw.ReadUint32Checked()
if err != nil {
return errors.Wrap(err, "read vector weights length")
}
vectorWeights, err := rw.ReadBytesFromBufferChecked(uint64(vectorWeightsLength))
if err != nil {
return errors.Wrap(err, "read vector weights")
}
vectors, err := unmarshalTargetVectors(&rw)
if err != nil {
return errors.Wrap(err, "unmarshal target vectors")
}
ko.Vectors = vectors
multiVectors, err := unmarshalMultiVectors(&rw, nil)
if err != nil {
return errors.Wrap(err, "unmarshal multi vectors")
}
ko.MultiVectors = multiVectors
View on GitHub (pinned to 75aa4b6d11)
Solutions
- Ensure writer and reader Weaviate versions match; migrate via backup/export rather than copying files between versions.
- Restore the affected shard from backup and re-ingest.
- Run crash recovery on the LSM store to remove partially written segments.
- If the blob legitimately lacks vector weights (older format), upgrade to a reader that tolerates their absence, or file an issue.
Defensive patterns
Strategy: validation
Validate before calling
if len(blob) == 0 {
return nil // empty blobs are valid and mean 'no object'
} Try / catch
obj, err := storobj.FromBinary(blob)
if err != nil {
if errors.Is(err, context.DeadlineExceeded) { return nil, err }
corrupted++
return nil // count and skip corrupt blobs
} Prevention
- Match writer/reader versions; the vector-weights section is version-sensitive.
- Keep backups so a corrupt shard can be restored without data loss.
- Avoid editing or truncating segment files with external tools.
- Log the full wrapped error chain to identify which field was being read.
When it happens
Trigger: Decoding a blob that ends right after the meta section but should have contained vector weights; any truncation or misparse of preceding length-prefixed fields.
Common situations: Corrupted segment files after unclean shutdown; blobs written by an older writer that omitted the vector-weights section being parsed with a newer reader expecting it; incomplete replication transfer.
Related errors
- unmarshal data object at position %d: %w
- unmarshalling object '%s': %w
- %w: unmarshal data object doc id %d
- parse uuid: %w
- read vector length: %w
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/86541488b98a14f8.
Report an issue: GitHub.