{"record":{"id":"a1c0cd735e173c17","repo":"stanford-oval/storm","slug":"invalid-vector-db-mode-please-provide-either-onl","errorCode":null,"errorMessage":"Invalid vector_db_mode. Please provide either 'online' or 'offline'.","messagePattern":"Invalid vector_db_mode\\. Please provide either 'online' or 'offline'\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"knowledge_storm/utils.py","lineNumber":233,"sourceCode":"            raise ValueError(\"Please provide the name of the url column.\")\n\n        # try to initialize the Qdrant client\n        qdrant = None\n        if vector_db_mode == \"online\":\n            qdrant = QdrantVectorStoreManager._init_online_vector_db(\n                url=url,\n                api_key=qdrant_api_key,\n                collection_name=collection_name,\n                model=model,\n            )\n        elif vector_db_mode == \"offline\":\n            qdrant = QdrantVectorStoreManager._init_offline_vector_db(\n                vector_store_path=vector_store_path,\n                collection_name=collection_name,\n                model=model,\n            )\n        else:\n            raise ValueError(\n                \"Invalid vector_db_mode. Please provide either 'online' or 'offline'.\"\n            )\n        if qdrant is None:\n            raise ValueError(\"Qdrant client is not initialized.\")\n\n        # read the csv file\n        import pandas as pd\n\n        df = pd.read_csv(file_path)\n        # check that content column exists and url column exists\n        if content_column not in df.columns:\n            raise ValueError(\n                f\"Content column {content_column} not found in the csv file.\"\n            )\n        if url_column not in df.columns:\n            raise ValueError(f\"URL column {url_column} not found in the csv file.\")\n\n        documents = [","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/utils.py#L215-L251","documentation":"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.","triggerScenarios":"Passing vector_db_mode='local', 'Online', 'OFFLINE ', None, or any other string.","commonSituations":"Config-driven mode strings from YAML/env vars with unexpected casing or whitespace, or older examples using different mode names.","solutions":["Set vector_db_mode='offline' for an embedded local store or 'online' for a Qdrant server","Strip/normalize config values: value.strip().lower() before passing","Check for trailing whitespace or case differences in the supplied string"],"exampleFix":"# before\nmode = config.get('vector_db_mode', 'local')\n# after\nmode = config.get('vector_db_mode', 'offline').strip().lower()","handlingStrategy":"type-guard","validationCode":"mode = (vector_db_mode or '').strip().lower()\nif mode not in ('online', 'offline'):\n    raise SystemExit(f\"vector_db_mode must be 'online' or 'offline', got {vector_db_mode!r}\")","typeGuard":"def is_valid_vector_db_mode(mode: str | None) -> bool:\n    return isinstance(mode, str) and mode.strip().lower() in ('online', 'offline')","tryCatchPattern":"try:\n    create_or_update_vector_store(..., vector_db_mode=mode)\nexcept ValueError as e:\n    if 'Invalid vector_db_mode' in str(e):\n        mode = 'offline'  # safe default for local use\n        create_or_update_vector_store(..., vector_db_mode=mode)\n    else:\n        raise","preventionTips":["Normalize mode strings from config/env with .strip().lower()","Use a Literal['online','offline'] type in typed wrappers"],"tags":["qdrant","mode","invalid-value","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"fb951af7744dab086e34962e9bc6fe878e145f83","analyzedAt":"2026-08-28T11:56:54.780Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}