MemPalace/mempalace · error · ValueError

row {idx}: id byte length {doc_id_bytes} exceeds {DRAWER_ID_

Error message

row {idx}: id byte length {doc_id_bytes} exceeds {DRAWER_ID_MAX_LENGTH}

What it means

Error "row {idx}: id byte length {doc_id_bytes} exceeds {DRAWER_ID_MAX_LENGTH}" thrown in MemPalace/mempalace.

Source

Thrown at mempalace/backends/milvus.py:510

        if metadatas is not None and len(metadatas) != len(ids):
            raise ValueError(
                f"metadatas length {len(metadatas)} does not match ids length {len(ids)}"
            )
        if len(embeddings) != len(ids):
            raise ValueError(
                f"embeddings length {len(embeddings)} does not match ids length {len(ids)}"
            )
        vectors, dimension = _normalize_vectors(embeddings)
        metadatas = metadatas or [{} for _ in ids]
        rows = []
        for idx, (doc_id, document, metadata, vector) in enumerate(
            zip(ids, documents, metadatas, vectors)
        ):
            if not isinstance(doc_id, str) or not doc_id:
                raise ValueError(f"row {idx}: id must be a non-empty string")
            doc_id_bytes = _utf8_len(doc_id)
            if doc_id_bytes > DRAWER_ID_MAX_LENGTH:
                raise ValueError(
                    f"row {idx}: id byte length {doc_id_bytes} exceeds {DRAWER_ID_MAX_LENGTH}"
                )
            document = _clean_text(document)
            document_bytes = _utf8_len(document)
            if document_bytes > DOCUMENT_MAX_LENGTH:
                raise ValueError(
                    f"row {idx}: document byte length {document_bytes} exceeds "
                    f"Milvus VARCHAR limit {DOCUMENT_MAX_LENGTH}; chunk before storing"
                )
            row = {
                FIELD_ID: doc_id,
                FIELD_DOCUMENT: document,
                FIELD_METADATA: _jsonable_metadata(metadata),
                FIELD_VECTOR: vector,
            }
            row.update(row[FIELD_METADATA])
            rows.append(row)
        return rows, dimension

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Shorten drawer ids below the byte limit, or re-chunk so ids stay within DRAWER_ID_MAX_LENGTH

When it happens

Trigger: Thrown at mempalace/backends/milvus.py:510 when the library encounters an invalid state.

Common situations: Drawer id derived from an overly long source path or content exceeded the limit.


AI-assisted analysis of MemPalace/mempalace@06cb6987f0 (2026-08-15). Data as JSON: /api/errors/d6f85795a7c96664. Report an issue: GitHub.