{"record":{"id":"479d1b3807cb1294","repo":"MemPalace/mempalace","slug":"collection-name-479d1b","errorCode":null,"errorMessage":"{collection_name}","messagePattern":"\\{collection_name\\}","errorType":"exception","errorClass":"CollectionNotInitializedError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/qdrant.py","lineNumber":973,"sourceCode":"        if query_texts is not None:\n            raise ValueError(\"qdrant requires query_embeddings; use palace.get_collection wrapper\")\n        if query_embeddings is None:\n            raise ValueError(\"query requires query_embeddings\")\n        if not query_embeddings:\n            raise ValueError(\"query input must be a non-empty list\")\n        _validate_where(where)\n        _validate_where(where_document)\n        if _requires_local_filter(where, where_document):\n            return self._query_local_exact(\n                query_embeddings=query_embeddings,\n                n_results=n_results,\n                where=where,\n                where_document=where_document,\n                include=include,\n            )\n        if not self._remote_exists():\n            if self._marker_exists():\n                raise CollectionNotInitializedError(self._collection_name)\n            return QueryResult.empty(\n                num_queries=len(query_embeddings),\n                embeddings_requested=bool(include and \"embeddings\" in include),\n            )\n\n        spec = _IncludeSpec.resolve(include, default_distances=True)\n        q_filter = _qdrant_filter(where)\n        outer_ids: list[list[str]] = []\n        outer_docs: list[list[str]] = []\n        outer_metas: list[list[dict]] = []\n        outer_dists: list[list[float]] = []\n        outer_embeds: list[list[list[float]]] = []\n        for query_vector in query_embeddings:\n            q = _as_vector_array(query_vector)\n            if self._known_dimension is None:\n                self._known_dimension = self._remote_dimension()\n            if self._known_dimension is not None and int(q.size) != self._known_dimension:\n                raise DimensionMismatchError(","sourceCodeStart":955,"sourceCodeEnd":991,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/qdrant.py#L955-L991","documentation":"Raised by QdrantCollection.query() when the local marker file says the collection should exist but the remote Qdrant collection does not. CollectionNotInitializedError (a PalaceNotFoundError subclass): the palace metadata and the server have diverged — typically the Qdrant data volume was wiped or the collection was deleted server-side while local state still references it.","triggerScenarios":"marker_exists() is true but _remote_exists() is false: someone dropped the collection in the Qdrant dashboard, the docker volume was recreated, Qdrant restarted with ephemeral storage, or a partial backend migration left stale markers.","commonSituations":"docker compose down -v wiping the Qdrant volume; switching between an embedded and a remote Qdrant pointing at the same palace dir; server redeployed without persistent storage; manual cleanup that deleted collections but not the palace sidecar markers.","solutions":["Recreate the collection: either re-ingest the data (searcher can rebuild) or call upsert() again — _ensure_remote_collection will recreate the collection on next write","Or clear the stale marker so the backend treats the collection as absent (query then returns empty instead of raising)","Give Qdrant a persistent volume (docker volume mount) so collections survive restarts","If the palace directory was copied from another machine, expect marker/remote divergence; rebuild via the repair tooling (mempalace repair)"],"exampleFix":"# before\n# Qdrant volume wiped; marker remains:\ncollection.query(query_embeddings=[q])  # CollectionNotInitializedError\n// after\n# re-ingest: first write recreates the remote collection\ncollection.upsert(documents=docs, ids=ids, embeddings=embs)\ncollection.query(query_embeddings=[q])","handlingStrategy":"fallback","validationCode":"if not collection._remote_exists() and collection._marker_exists():\n    logger.warning(\"marker present but remote collection missing; will re-create on next write\")","typeGuard":null,"tryCatchPattern":"from mempalace.backends.base import CollectionNotInitializedError\ntry:\n    res = collection.query(query_embeddings=[q])\nexcept CollectionNotInitializedError:\n    res = QueryResult.empty(num_queries=1)  # or trigger re-ingest / repair","preventionTips":["Mount a persistent volume for Qdrant so collections survive restarts","Run mempalace repair after any server reset or volume change","After wiping Qdrant, also remove or refresh palace markers to keep state consistent"],"tags":["state-divergence","qdrant","collections","docker"],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}