stanford-oval/storm · error · ValueError

Error occurs when loading the vector store: {e}

Error message

Error occurs when loading the vector store: {e}

What it means

init_offline_vector_db wraps QdrantClient(path=...) and _check_collection in try/except and re-raises anything as ValueError('Error occurs when loading the vector store: {e}'). Typical inner causes: the directory is not a valid Qdrant storage folder, lock contention, or the collection not existing in that path.

Source

Thrown at knowledge_storm/rm.py:289

            raise ValueError(f"Error occurs when connecting to the server: {e}")

    def init_offline_vector_db(self, vector_store_path: str):
        from qdrant_client import QdrantClient

        """
        Initialize the Qdrant client that is connected to an offline vector store with the given vector store folder path.

        Args:
            vector_store_path (str): Path to the vector store.
        """
        if vector_store_path is None:
            raise ValueError("Please provide a folder path.")

        try:
            self.client = QdrantClient(path=vector_store_path)
            self._check_collection()
        except Exception as e:
            raise ValueError(f"Error occurs when loading the vector store: {e}")

    def get_usage_and_reset(self):
        usage = self.usage
        self.usage = 0

        return {"VectorRM": usage}

    def get_vector_count(self):
        """
        Get the count of vectors in the collection.

        Returns:
            int: Number of vectors in the collection.
        """
        return self.qdrant.client.count(collection_name=self.collection_name)

    def forward(self, query_or_queries: Union[str, List[str]], exclude_urls: List[str]):
        """

View on GitHub (pinned to fb951af774)

Solutions

  1. Check the appended inner exception for the real cause
  2. Verify the folder contains Qdrant files (collections/ subdir) and was written by the same qdrant-client version
  3. Ensure no other process has the store open — close other clients before loading; delete and rebuild the store if corrupt
  4. Use an absolute path to avoid cwd-dependent resolution

Example fix

// before
rm.init_offline_vector_db('./qdrant_missing')  # ValueError: Error occurs when loading the vector store: ...
// after
import os
path = os.path.abspath('./qdrant')
assert os.path.isdir(os.path.join(path, 'collections'))
rm.init_offline_vector_db(path)
Defensive patterns

Strategy: validation

Validate before calling

import os
STORE = os.path.abspath('./qdrant')
assert os.path.isdir(os.path.join(STORE, 'collections')), f'{STORE} is not a Qdrant store'
rm.init_offline_vector_db(STORE)

Type guard

def is_qdrant_store(path: str) -> bool:
    import os
    return os.path.isdir(os.path.join(path, 'collections'))

Try / catch

try:
    rm.init_offline_vector_db(STORE)
except ValueError as e:
    msg = str(e)
    if 'does not exist' in msg:
        raise SystemExit('Store valid but collection missing — rebuild ingestion')
    if 'lock' in msg.lower() or 'another process' in msg.lower():
        raise SystemExit('Close other processes holding the local store')
    raise

Prevention

When it happens

Trigger: Pointing vector_store_path at an empty/nonexistent directory; a directory created by a different (incompatible) Qdrant client version; another process holding the local store's lock (local Qdrant mode allows a single process); or the collection missing in the folder, funnelled through _check_collection.

Common situations: Reusing a path where ingestion crashed midway; opening the same offline store from two scripts simultaneously; upgrading qdrant-client and hitting on-disk format incompatibilities; wrong path casing/relative path resolved from a different cwd.

Related errors


AI-assisted analysis of stanford-oval/storm@fb951af774 (2026-08-28). Data as JSON: /api/errors/6af2c8043cebf8b1. Report an issue: GitHub.