{"record":{"id":"f4e16adf596afbb0","repo":"BerriAI/litellm","slug":"error-while-creating-new-collection","errorCode":null,"errorMessage":"Error while creating new collection","messagePattern":"Error while creating new collection","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/caching/qdrant_semantic_cache.py","lineNumber":144,"sourceCode":"\n            new_collection_status: Final = self.sync_client.put(\n                url=f\"{self.qdrant_api_base}/collections/{self.collection_name}\",\n                json={\n                    \"vectors\": {\"size\": self.vector_size, \"distance\": \"Cosine\"},\n                    \"quantization_config\": quantization_params,\n                },\n                headers=self.headers,\n            )\n            if new_collection_status.json()[\"result\"]:\n                collection_details = self.sync_client.get(\n                    url=f\"{self.qdrant_api_base}/collections/{self.collection_name}\",\n                    headers=self.headers,\n                )\n                self.collection_info = collection_details.json()\n                print_verbose(f\"New collection created.\\nCollection details:{self.collection_info}\")\n                self._ensure_cache_key_payload_index()\n            else:\n                raise Exception(\"Error while creating new collection\")\n\n    def _get_cache_logic(self, cached_response: Any):\n        if cached_response is None:\n            return cached_response\n        try:\n            cached_response = json.loads(cached_response)  # Convert string to dictionary\n        except Exception:\n            cached_response = ast.literal_eval(cached_response)\n        return cached_response\n\n    def _get_qdrant_cache_key_filter(self, key: str) -> dict:\n        return {\n            \"must\": [\n                {\n                    \"key\": self.CACHE_KEY_FIELD_NAME,\n                    \"match\": {\"value\": str(key)},\n                }\n            ]","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/caching/qdrant_semantic_cache.py#L126-L162","documentation":"The PUT request that creates the Qdrant collection (with vector size, Cosine distance and quantization config) failed or returned a falsy result, so the semantic cache could not establish its backing collection.","triggerScenarios":"Thrown at litellm/caching/qdrant_semantic_cache.py:144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check Qdrant server logs for the collection creation failure (permissions, storage, or name conflict).","Delete any conflicting existing collection or use a different collection_name, then retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}