{"record":{"id":"b7ad0f9cb7a4301a","repo":"MemPalace/mempalace","slug":"row-idx-document-byte-length-document-bytes-e","errorCode":null,"errorMessage":"row {idx}: document byte length {document_bytes} exceeds Milvus VARCHAR limit {DOCUMENT_MAX_LENGTH}; chunk before storing","messagePattern":"row (.+?): document byte length (.+?) exceeds Milvus VARCHAR limit (.+?); chunk before storing","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/milvus.py","lineNumber":516,"sourceCode":"                f\"embeddings length {len(embeddings)} does not match ids length {len(ids)}\"\n            )\n        vectors, dimension = _normalize_vectors(embeddings)\n        metadatas = metadatas or [{} for _ in ids]\n        rows = []\n        for idx, (doc_id, document, metadata, vector) in enumerate(\n            zip(ids, documents, metadatas, vectors)\n        ):\n            if not isinstance(doc_id, str) or not doc_id:\n                raise ValueError(f\"row {idx}: id must be a non-empty string\")\n            doc_id_bytes = _utf8_len(doc_id)\n            if doc_id_bytes > DRAWER_ID_MAX_LENGTH:\n                raise ValueError(\n                    f\"row {idx}: id byte length {doc_id_bytes} exceeds {DRAWER_ID_MAX_LENGTH}\"\n                )\n            document = _clean_text(document)\n            document_bytes = _utf8_len(document)\n            if document_bytes > DOCUMENT_MAX_LENGTH:\n                raise ValueError(\n                    f\"row {idx}: document byte length {document_bytes} exceeds \"\n                    f\"Milvus VARCHAR limit {DOCUMENT_MAX_LENGTH}; chunk before storing\"\n                )\n            row = {\n                FIELD_ID: doc_id,\n                FIELD_DOCUMENT: document,\n                FIELD_METADATA: _jsonable_metadata(metadata),\n                FIELD_VECTOR: vector,\n            }\n            row.update(row[FIELD_METADATA])\n            rows.append(row)\n        return rows, dimension\n\n    def add(self, *, documents, ids, metadatas=None, embeddings=None):\n        if embeddings is None:\n            raise ValueError(\"milvus requires explicit embeddings\")\n        if len(set(ids)) != len(ids):\n            raise ValueError(\"add ids must be unique\")","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/milvus.py#L498-L534","documentation":"Error \"row {idx}: document byte length {document_bytes} exceeds Milvus VARCHAR limit {DOCUMENT_MAX_LENGTH}; chunk before storing\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/backends/milvus.py:516 when the library encounters an invalid state.","commonSituations":"A single verbatim drawer exceeded the Milvus VARCHAR field capacity; chunking was skipped or mis-sized.","solutions":["Chunk the document into smaller pieces before storing so each stays under the Milvus VARCHAR limit"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}