{"record":{"id":"7b18fe77968d2fb4","repo":"open-webui/open-webui","slug":"qdrant-uri-is-not-set-please-configure-it-in-the","errorCode":null,"errorMessage":"QDRANT_URI is not set. Please configure it in the environment variables.","messagePattern":"QDRANT_URI is not set\\. Please configure it in the environment variables\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/open_webui/retrieval/vector/dbs/qdrant_multitenancy.py","lineNumber":58,"sourceCode":"\n\ndef _metadata_filter(key: str, value: Any) -> models.FieldCondition:\n    return models.FieldCondition(key=f'metadata.{key}', match=models.MatchValue(value=value))\n\n\nclass QdrantClient(VectorDBBase):\n    def __init__(self):\n        self.collection_prefix = QDRANT_COLLECTION_PREFIX\n        self.QDRANT_URI = QDRANT_URI\n        self.QDRANT_API_KEY = QDRANT_API_KEY\n        self.QDRANT_ON_DISK = QDRANT_ON_DISK\n        self.PREFER_GRPC = QDRANT_PREFER_GRPC\n        self.GRPC_PORT = QDRANT_GRPC_PORT\n        self.QDRANT_TIMEOUT = QDRANT_TIMEOUT\n        self.QDRANT_HNSW_M = QDRANT_HNSW_M\n\n        if not self.QDRANT_URI:\n            raise ValueError('QDRANT_URI is not set. Please configure it in the environment variables.')\n\n        # Unified handling for either scheme\n        parsed = urlparse(self.QDRANT_URI)\n        host = parsed.hostname or self.QDRANT_URI\n        http_port = parsed.port or 6333  # default REST port\n\n        self.client = (\n            Qclient(\n                host=host,\n                port=http_port,\n                grpc_port=self.GRPC_PORT,\n                prefer_grpc=self.PREFER_GRPC,\n                api_key=self.QDRANT_API_KEY,\n                timeout=self.QDRANT_TIMEOUT,\n            )\n            if self.PREFER_GRPC\n            else Qclient(\n                url=self.QDRANT_URI,","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/open-webui/open-webui/blob/01f4282f1ffe0d6212f58d3afbeae21fffd0c4be/backend/open_webui/retrieval/vector/dbs/qdrant_multitenancy.py#L40-L76","documentation":"QdrantClient (multitenancy variant) __init__ raises ValueError immediately when QDRANT_URI is empty. Unlike the standard qdrant client, this backend has no localhost default — every multitenant collection path is derived from the URI, so it refuses to construct without it.","triggerScenarios":"VECTOR_DB=qdrant_multitenancy (selecting this client class) with QDRANT_URI unset, empty, or whitespace in the process environment.","commonSituations":"Switching from the regular qdrant backend (which tolerated a default) to the multitenancy one without adding QDRANT_URI; .env not mounted into the container; variable defined in docker-compose for a different service only.","solutions":["Set QDRANT_URI, e.g. QDRANT_URI=http://localhost:6333 (a URL with optional scheme/port; also supports grpc when QDRANT_PREFER_GRPC=true).","Confirm the value reaches the process: docker exec <container> env | grep QDRANT.","Check for typos/empty assignments like QDRANT_URI= with nothing after the equals.","Verify the server is reachable at that URI so init proceeds past this check."],"exampleFix":"# before\nVECTOR_DB=qdrant_multitenancy\n# after\nVECTOR_DB=qdrant_multitenancy\nQDRANT_URI=http://qdrant:6333","handlingStrategy":"validation","validationCode":"import os\nassert os.getenv('QDRANT_URI'), 'QDRANT_URI must be set when VECTOR_DB=qdrant_multitenancy'","typeGuard":null,"tryCatchPattern":"try:\n    client = QdrantClient()  # multitenancy variant\nexcept ValueError as e:\n    if 'QDRANT_URI is not set' in str(e):\n        fail_fast('Set QDRANT_URI (e.g. http://qdrant:6333) and restart')\n    raise","preventionTips":["When switching VECTOR_DB to qdrant_multitenancy, add QDRANT_URI in the same change — this backend has no default.","Include the scheme and port in QDRANT_URI so URL parsing yields the right host/port for both REST and gRPC.","Set QDRANT_PREFER_GRPC/QDRANT_GRPC_PORT together if you intend to use gRPC."],"tags":["qdrant","configuration","environment-variables","startup","vector-db"],"backgroundTag":null,"analyzedSha":"01f4282f1ffe0d6212f58d3afbeae21fffd0c4be","analyzedAt":"2026-08-14T18:25:22.715Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}