{"record":{"id":"b492a30e9cbf13ea","repo":"MemPalace/mempalace","slug":"milvus-collection-self-collection-name-r-expect","errorCode":null,"errorMessage":"milvus collection {self._collection_name!r} expects embedding dimension {self._known_dimension}, got {dimension}","messagePattern":"milvus collection (.+?) expects embedding dimension (.+?), got (.+?)","errorType":"exception","errorClass":"DimensionMismatchError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/milvus.py","lineNumber":398,"sourceCode":"            name = field.get(\"name\") or field.get(\"field_name\")\n            if name != FIELD_VECTOR:\n                continue\n            params = field.get(\"params\") or field.get(\"type_params\") or {}\n            dim = field.get(\"dim\") or params.get(\"dim\")\n            try:\n                return int(dim)\n            except (TypeError, ValueError):\n                return None\n        return None\n\n    def _ensure_remote_collection(self, dimension: int) -> None:\n        if dimension <= 0:\n            raise ValueError(\"embedding dimension must be positive\")\n        with self._lock:\n            self._ensure_open()\n            if self._known_dimension is not None:\n                if self._known_dimension != dimension:\n                    raise DimensionMismatchError(\n                        f\"milvus collection {self._collection_name!r} expects \"\n                        f\"embedding dimension {self._known_dimension}, got {dimension}\"\n                    )\n                return\n            if not self._remote_exists():\n                self._backend._create_remote_collection(\n                    self._client,\n                    self._remote_collection,\n                    dimension,\n                    consistency_level=self._config.consistency_level,\n                )\n                self._backend._load_remote_collection(self._client, self._remote_collection)\n                self._known_dimension = dimension\n                self._known_native_lexical = True\n                self._backend._write_marker(self._palace, self._config)\n                return\n            remote_dim = self._remote_dimension()\n            if remote_dim is not None and remote_dim != dimension:","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/milvus.py#L380-L416","documentation":"Error \"milvus collection {self._collection_name!r} expects embedding dimension {self._known_dimension}, got {dimension}\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/backends/milvus.py:398 when the library encounters an invalid state.","commonSituations":"Embedding model was changed after the collection was created, or the wrong model is configured for this palace.","solutions":["Re-embed the palace with the matching embedding model, or recreate the milvus collection with the expected dimension","Verify the configured MEMPALACE_EMBEDDING_MODEL matches the model used to build the collection"],"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"}