{"record":{"id":"67c47087ecbae4ae","repo":"weaviate/weaviate","slug":"read-vector-weights-length-w","errorCode":null,"errorMessage":"read vector weights length: %w","messagePattern":"read vector weights length: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"entities/storobj/storage_object.go","lineNumber":316,"sourceCode":"\t\treturn nil, fmt.Errorf(\"read properties: %w\", err)\n\t}\n\n\tmetaLength, err := rw.ReadUint32Checked()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"read meta length: %w\", err)\n\t}\n\tvar meta []byte\n\tif addProp.Classification || len(addProp.ModuleParams) > 0 {\n\t\tif meta, err = rw.ReadBytesFromBufferChecked(uint64(metaLength)); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"read meta: %w\", err)\n\t\t}\n\t} else if err := rw.SkipChecked(uint64(metaLength)); err != nil {\n\t\treturn nil, fmt.Errorf(\"skip meta: %w\", err)\n\t}\n\n\tvectorWeightsLength, err := rw.ReadUint32Checked()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"read vector weights length: %w\", err)\n\t}\n\tvectorWeights, err := rw.ReadBytesFromBufferChecked(uint64(vectorWeightsLength))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"read vector weights: %w\", err)\n\t}\n\n\tif len(addProp.Vectors) > 0 {\n\t\tvectors, err := unmarshalTargetVectors(&rw)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tko.Vectors = vectors\n\n\t\tif vectors != nil {\n\t\t\t// If parseObject is called, ko.Object will be overwritten making this effectively a\n\t\t\t// no-op, but I'm leaving it here for now to avoid breaking anything.\n\t\t\tko.Object.Vectors = make(models.Vectors)\n\t\t\tfor vecName, vec := range vectors {","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/entities/storobj/storage_object.go#L298-L334","documentation":"Returned when reading the uint32 vector-weights length field fails because the buffer is exhausted at that point. The field follows the meta region; hitting this error means the record ends before it. It is a checked-reader guard against parsing beyond the payload.","triggerScenarios":"FromBinaryOptionalNetwork/Disk on records truncated before the vector-weights length, e.g. buffer ending inside or right after the meta region. Also from cursor misalignment due to earlier misparsed lengths.","commonSituations":"Cross-version deserialization where preceding field layouts differ, damaged LSM segments, or incomplete replication payloads.","solutions":["Verify identical Weaviate versions/format on both ends of the transfer.","Restore corrupted segments from backup or reindex the collection.","Check the caller passes the full, intact record bytes.","Log the record bytes for offline analysis if corruption recurs."],"exampleFix":"// before\nobj, err := storobj.FromBinaryOptionalNetwork(ctx, b, addProp)\n// after\nif got, want := len(b), minLen; got < want {\n    return fmt.Errorf(\"payload %d < minimum %d\", got, want)\n}\nobj, err := storobj.FromBinaryOptionalNetwork(ctx, b, addProp)","handlingStrategy":"validation","validationCode":"if len(b) == 0 { return errors.New(\"empty record\") }\nobj, err := storobj.FromBinaryOptionalDisk(b)","typeGuard":null,"tryCatchPattern":"obj, err := storobj.FromBinaryOptionalDisk(b)\nif err != nil {\n    return nil, fmt.Errorf(\"unreadable record (vector weights length): %w\", err)\n}","preventionTips":["Pin all nodes to the same Weaviate version","Reindex collections if segment corruption is suspected","Never hand-trim stored record bytes"],"tags":["serialization","storage","vectors","truncated-data"],"backgroundTag":"buffer-underflow-deserialization","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"}