{"record":{"id":"a71505d182f9787b","repo":"MemPalace/mempalace","slug":"metadatas-length-len-metadatas-does-not-match-i","errorCode":null,"errorMessage":"metadatas length {len(metadatas)} does not match ids length {len(ids)}","messagePattern":"metadatas length (.+?) does not match ids length (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/milvus.py","lineNumber":493,"sourceCode":"        row = dict(entity or {})\n        row[FIELD_ID] = str(doc_id)\n        row[\"distance\"] = float(score or 0.0)\n        return row\n\n    def _prepare_rows(\n        self,\n        *,\n        documents: list[str],\n        ids: list[str],\n        metadatas: Optional[list[dict]],\n        embeddings: list[list[float]],\n    ) -> tuple[list[dict], int]:\n        if len(documents) != len(ids):\n            raise ValueError(\n                f\"documents length {len(documents)} does not match ids length {len(ids)}\"\n            )\n        if metadatas is not None and len(metadatas) != len(ids):\n            raise ValueError(\n                f\"metadatas length {len(metadatas)} does not match ids length {len(ids)}\"\n            )\n        if len(embeddings) != len(ids):\n            raise ValueError(\n                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}\"","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/milvus.py#L475-L511","documentation":"Error \"metadatas length {len(metadatas)} does not match ids length {len(ids)}\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/backends/milvus.py:493 when the library encounters an invalid state.","commonSituations":"Metadatas list was constructed separately from ids and lengths diverged.","solutions":["Pass one metadata dict per id; align the metadatas list with the ids list"],"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"}