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

A catch-all in _init_offline_vector_db wrapping any exception thrown while constructing QdrantClient(path=...) or creating/checking the collection. The original exception text is appended, so the real cause (locked store, corrupt data, permission error, dimension mismatch) is embedded in the message.

Source

Thrown at knowledge_storm/utils.py:149

        vector_store_path: str, collection_name: str, model: "HuggingFaceEmbeddings"
    ):
        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:
            client = QdrantClient(path=vector_store_path)
            return QdrantVectorStoreManager._check_create_collection(
                client=client, collection_name=collection_name, model=model
            )
        except Exception as e:
            raise ValueError(f"Error occurs when loading the vector store: {e}")

    @staticmethod
    def create_or_update_vector_store(
        collection_name: str,
        vector_db_mode: str,
        file_path: str,
        content_column: str,
        title_column: str = "title",
        url_column: str = "url",
        desc_column: str = "description",
        batch_size: int = 64,
        chunk_size: int = 500,
        chunk_overlap: int = 100,
        vector_store_path: str = None,
        url: str = None,
        qdrant_api_key: str = None,
        embedding_model: str = "BAAI/bge-m3",
        device: str = "mps",

View on GitHub (pinned to fb951af774)

Solutions

  1. Read the inner {e} text to identify the real cause before changing anything
  2. If another process holds the store, close it or use server mode ('online') which supports concurrent access
  3. If dimensions changed, delete/rename the old store folder so it is recreated
  4. Verify permissions and that the path is (or can be) an empty Qdrant directory

Example fix

# before
qdrant = QdrantVectorStoreManager._init_offline_vector_db('./store', 'c', model)
# after
import shutil
shutil.rmtree('./store', ignore_errors=True)  # recreate if dimension mismatch/corruption
qdrant = QdrantVectorStoreManager._init_offline_vector_db('./store', 'c', model)
Defensive patterns

Strategy: try-catch

Validate before calling

from pathlib import Path
p = Path('./qdrant_store')
if p.exists() and any(p.iterdir()) and not (p / 'meta.sqlite').exists():
    print('Warning: folder has non-Qdrant contents')

Try / catch

try:
    create_or_update_vector_store(..., vector_db_mode='offline', vector_store_path='./store')
except ValueError as e:
    msg = str(e)
    if 'loading the vector store' in msg:
        # inspect inner cause in msg after the colon
        log.error('Qdrant init failed: %s', msg.split(':', 1)[-1].strip())
        raise
    raise

Prevention

When it happens

Trigger: Opening an offline Qdrant folder already locked by another process, a corrupted/foreign Qdrant directory, insufficient read/write permissions, or a collection whose vector size differs from the embedding model dimension.

Common situations: Two workers/scripts opening the same offline store simultaneously, pointing vector_store_path at a non-empty unrelated directory, or switching embedding models against an existing collection.

Related errors


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