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

  1. Ensure writer and reader Weaviate versions match; migrate via backup/export rather than copying files between versions.
  2. Restore the affected shard from backup and re-ingest.
  3. Run crash recovery on the LSM store to remove partially written segments.
  4. 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

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


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