{"record":{"id":"e36c40f5dc9a49ee","repo":"stanford-oval/storm","slug":"please-provide-a-folder-path","errorCode":null,"errorMessage":"Please provide a folder path.","messagePattern":"Please provide a folder path\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"knowledge_storm/rm.py","lineNumber":283,"sourceCode":"            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.\")\n\n        try:\n            self.client = QdrantClient(path=vector_store_path)\n            self._check_collection()\n        except Exception as e:\n            raise ValueError(f\"Error occurs when loading the vector store: {e}\")\n\n    def get_usage_and_reset(self):\n        usage = self.usage\n        self.usage = 0\n\n        return {\"VectorRM\": usage}\n\n    def get_vector_count(self):\n        \"\"\"\n        Get the count of vectors in the collection.\n\n        Returns:","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/rm.py#L265-L301","documentation":"For source='offline', VectorRM.init_offline_vector_db requires the filesystem path of a pre-built local Qdrant store. Passing vector_store_path=None — note this is the method parameter, distinct from the similarly named constructor argument — raises ValueError before QdrantClient(path=...) is attempted.","triggerScenarios":"Calling rm.init_offline_vector_db() with no argument because the constructor already took vector_store_path and the developer assumed it would be reused; explicitly passing None.","commonSituations":"Confusion between the constructor's vector_store_path kwarg and the init method's parameter of the same name; refactors that pass the path only at construction.","solutions":["Pass the path to the init method: rm.init_offline_vector_db('./qdrant_store')","Pass the same path in both places if your framework requires constructing VectorRM with it","Ensure the directory exists and contains a Qdrant store created with QdrantClient(path=...)"],"exampleFix":"// before\nrm = VectorRM(collection_name='docs', source='offline', vector_store_path='./qdrant', embedding_model='...')\nrm.init_offline_vector_db()  # missing path\n// after\nrm = VectorRM(collection_name='docs', source='offline', vector_store_path='./qdrant', embedding_model='...')\nrm.init_offline_vector_db('./qdrant')","handlingStrategy":"validation","validationCode":"import os\nSTORE = os.path.abspath('./qdrant')\nif not STORE:\n    raise SystemExit('vector_store_path is required for init_offline_vector_db')\nrm.init_offline_vector_db(STORE)","typeGuard":"def valid_store_path(p: str | None) -> bool:\n    import os\n    return isinstance(p, str) and bool(p.strip()) and os.path.isdir(p)","tryCatchPattern":"try:\n    rm.init_offline_vector_db(store_path)\nexcept ValueError as e:\n    if 'folder path' in str(e):\n        raise SystemExit('Pass the store path to init_offline_vector_db, not only the constructor')\n    raise","preventionTips":["Use one absolute-path constant for the store and pass it to both the constructor and the init method","Add a startup check that the directory exists and contains collections/"],"tags":["python","qdrant","offline-mode","missing-required-parameter"],"backgroundTag":"missing-required-parameter","analyzedSha":"fb951af7744dab086e34962e9bc6fe878e145f83","analyzedAt":"2026-08-28T11:56:54.780Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}