{"record":{"id":"86541488b98a14f8","repo":"weaviate/weaviate","slug":"read-vector-weights-length","errorCode":null,"errorMessage":"read vector weights length","messagePattern":"read vector weights length","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"entities/storobj/storage_object.go","lineNumber":1606,"sourceCode":"\t\treturn errors.Wrap(err, \"read schema length\")\n\t}\n\tschema, err := rw.ReadBytesFromBufferChecked(uint64(schemaLength))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read schema\")\n\t}\n\n\tmetaLength, err := rw.ReadUint32Checked()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read meta length\")\n\t}\n\tmeta, err := rw.ReadBytesFromBufferChecked(uint64(metaLength))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read meta\")\n\t}\n\n\tvectorWeightsLength, err := rw.ReadUint32Checked()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read vector weights length\")\n\t}\n\tvectorWeights, err := rw.ReadBytesFromBufferChecked(uint64(vectorWeightsLength))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read vector weights\")\n\t}\n\n\tvectors, err := unmarshalTargetVectors(&rw)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unmarshal target vectors\")\n\t}\n\tko.Vectors = vectors\n\n\tmultiVectors, err := unmarshalMultiVectors(&rw, nil)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unmarshal multi vectors\")\n\t}\n\tko.MultiVectors = multiVectors\n","sourceCodeStart":1588,"sourceCodeEnd":1624,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/entities/storobj/storage_object.go#L1588-L1624","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(blob) == 0 {\n    return nil // empty blobs are valid and mean 'no object'\n}","typeGuard":null,"tryCatchPattern":"obj, err := storobj.FromBinary(blob)\nif err != nil {\n    if errors.Is(err, context.DeadlineExceeded) { return nil, err }\n    corrupted++\n    return nil // count and skip corrupt blobs\n}","preventionTips":["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."],"tags":["storage","deserialization","vector-weights"],"backgroundTag":"binary-deserialization-buffer-overrun","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"}