{"record":{"id":"a553365570805243","repo":"stanford-oval/storm","slug":"please-provide-a-url-for-the-qdrant-server","errorCode":null,"errorMessage":"Please provide a url for the Qdrant server.","messagePattern":"Please provide a url for the Qdrant server\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"knowledge_storm/rm.py","lineNumber":265,"sourceCode":"                f\"Collection {self.collection_name} does not exist. Please create the collection first.\"\n            )\n\n    def init_online_vector_db(self, url: str, api_key: str):\n        from qdrant_client import QdrantClient\n\n        \"\"\"\n        Initialize the Qdrant client that is connected to an online vector store with the given URL and API key.\n\n        Args:\n            url (str): URL of the Qdrant server.\n            api_key (str): API key for the Qdrant server.\n        \"\"\"\n        if api_key is None:\n            if not os.getenv(\"QDRANT_API_KEY\"):\n                raise ValueError(\"Please provide an api key.\")\n            api_key = os.getenv(\"QDRANT_API_KEY\")\n        if url is None:\n            raise ValueError(\"Please provide a url for the Qdrant server.\")\n\n        try:\n            self.client = QdrantClient(url=url, api_key=api_key)\n            self._check_collection()\n        except Exception as e:\n            raise ValueError(f\"Error occurs when connecting to the server: {e}\")\n\n    def init_offline_vector_db(self, vector_store_path: str):\n        from qdrant_client import QdrantClient\n\n        \"\"\"\n        Initialize the Qdrant client that is connected to an offline vector store with the given vector store folder path.\n\n        Args:\n            vector_store_path (str): Path to the vector store.\n        \"\"\"\n        if vector_store_path is None:\n            raise ValueError(\"Please provide a folder path.\")","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/rm.py#L247-L283","documentation":"init_online_vector_db requires a url for the Qdrant server; there is no environment fallback for it, unlike the API key. Passing url=None (the default when omitted) raises ValueError immediately.","triggerScenarios":"Calling rm.init_online_vector_db(api_key='...') with no url; calling rm.init_online_vector_db() with both url and api_key relying solely on QDRANT_API_KEY env var (url still missing).","commonSituations":"Assuming url also has an env-var fallback like QDRANT_URL; argument-order mistakes (passing api_key positionally into url); copied examples trimmed down to only the key.","solutions":["Pass the url explicitly, e.g. url='https://<cluster>.eu-central.aws.cloud.qdrant.io:6333'","Get the exact URL from the Qdrant Cloud dashboard for your cluster","If you want env-based config, read it yourself: url=os.environ['QDRANT_URL']"],"exampleFix":"// before\nrm.init_online_vector_db(api_key=os.environ['QDRANT_API_KEY'])\n// after\nrm.init_online_vector_db(url='https://xyz.cloud.qdrant.io:6333', api_key=os.environ['QDRANT_API_KEY'])","handlingStrategy":"validation","validationCode":"QDRANT_URL = 'https://xyz.cloud.qdrant.io:6333'\nif not QDRANT_URL:\n    raise SystemExit('url is required for init_online_vector_db')\nrm.init_online_vector_db(url=QDRANT_URL, api_key=os.environ['QDRANT_API_KEY'])","typeGuard":"def valid_qdrant_url(url: str | None) -> bool:\n    return isinstance(url, str) and url.startswith(('http://', 'https://'))","tryCatchPattern":"try:\n    rm.init_online_vector_db(url=url, api_key=key)\nexcept ValueError as e:\n    if 'url' in str(e):\n        raise SystemExit('Provide the Qdrant cluster URL from the cloud dashboard')\n    raise","preventionTips":["Keep url and api_key together in one config object so they're never passed separately","Remember only the API key has an env fallback — the URL must always be explicit"],"tags":["python","qdrant","configuration","missing-url"],"backgroundTag":"missing-required-parameter","analyzedSha":"fb951af7744dab086e34962e9bc6fe878e145f83","analyzedAt":"2026-08-28T11:56:54.780Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}