stanford-oval/storm · error · ValueError

Invalid vector_db_mode. Please provide either 'online' or 'o

Error message

Invalid vector_db_mode. Please provide either 'online' or 'offline'.

What it means

vector_db_mode must be exactly 'online' or 'offline'; anything else falls into the else branch. Common trip-ups: typos, capitalized values ('Online'), or None.

Source

Thrown at knowledge_storm/utils.py:233

            raise ValueError("Please provide the name of the url column.")

        # try to initialize the Qdrant client
        qdrant = None
        if vector_db_mode == "online":
            qdrant = QdrantVectorStoreManager._init_online_vector_db(
                url=url,
                api_key=qdrant_api_key,
                collection_name=collection_name,
                model=model,
            )
        elif vector_db_mode == "offline":
            qdrant = QdrantVectorStoreManager._init_offline_vector_db(
                vector_store_path=vector_store_path,
                collection_name=collection_name,
                model=model,
            )
        else:
            raise ValueError(
                "Invalid vector_db_mode. Please provide either 'online' or 'offline'."
            )
        if qdrant is None:
            raise ValueError("Qdrant client is not initialized.")

        # read the csv file
        import pandas as pd

        df = pd.read_csv(file_path)
        # check that content column exists and url column exists
        if content_column not in df.columns:
            raise ValueError(
                f"Content column {content_column} not found in the csv file."
            )
        if url_column not in df.columns:
            raise ValueError(f"URL column {url_column} not found in the csv file.")

        documents = [

View on GitHub (pinned to fb951af774)

Solutions

  1. Set vector_db_mode='offline' for an embedded local store or 'online' for a Qdrant server
  2. Strip/normalize config values: value.strip().lower() before passing
  3. Check for trailing whitespace or case differences in the supplied string

Example fix

# before
mode = config.get('vector_db_mode', 'local')
# after
mode = config.get('vector_db_mode', 'offline').strip().lower()
Defensive patterns

Strategy: type-guard

Validate before calling

mode = (vector_db_mode or '').strip().lower()
if mode not in ('online', 'offline'):
    raise SystemExit(f"vector_db_mode must be 'online' or 'offline', got {vector_db_mode!r}")

Type guard

def is_valid_vector_db_mode(mode: str | None) -> bool:
    return isinstance(mode, str) and mode.strip().lower() in ('online', 'offline')

Try / catch

try:
    create_or_update_vector_store(..., vector_db_mode=mode)
except ValueError as e:
    if 'Invalid vector_db_mode' in str(e):
        mode = 'offline'  # safe default for local use
        create_or_update_vector_store(..., vector_db_mode=mode)
    else:
        raise

Prevention

When it happens

Trigger: Passing vector_db_mode='local', 'Online', 'OFFLINE ', None, or any other string.

Common situations: Config-driven mode strings from YAML/env vars with unexpected casing or whitespace, or older examples using different mode names.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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