{"record":{"id":"23ef9219f4372b8c","repo":"langgenius/dify","slug":"unsupported-vector-db-type-vector-type","errorCode":null,"errorMessage":"Unsupported vector db type {vector_type}.","messagePattern":"Unsupported vector db type (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"api/controllers/console/datasets/datasets.py","lineNumber":432,"sourceCode":"        \"retrieval_method\": [\n            RetrievalMethod.SEMANTIC_SEARCH.value,\n            RetrievalMethod.FULL_TEXT_SEARCH.value,\n            RetrievalMethod.HYBRID_SEARCH.value,\n        ]\n    }\n\n    if vector_type == VectorType.MILVUS:\n        return semantic_methods if is_mock else full_methods\n\n    if vector_type == VectorType.TIDB_VECTOR:\n        return full_methods if dify_config.TIDB_VECTOR_ENABLE_FULLTEXT_SEARCH else semantic_methods\n\n    if vector_type in semantic_only_types:\n        return semantic_methods\n    elif vector_type in full_search_types:\n        return full_methods\n    else:\n        raise ValueError(f\"Unsupported vector db type {vector_type}.\")\n\n\n@console_ns.route(\"/datasets\")\nclass DatasetListApi(Resource):\n    @console_ns.doc(\"get_datasets\")\n    @console_ns.doc(description=\"Get list of datasets\")\n    @console_ns.doc(params=query_params_from_model(ConsoleDatasetListQuery))\n    @console_ns.response(200, \"Datasets retrieved successfully\", console_ns.models[DatasetListResponse.__name__])\n    @setup_required\n    @login_required\n    @account_initialization_required\n    @enterprise_license_required\n    @with_current_user\n    @with_current_tenant_id\n    @with_session(write=False)\n    def get(self, session: Session, current_tenant_id: str, current_user: Account):\n        # Convert query parameters to dict, handling list parameters correctly\n        query_params: dict[str, str | list[str]] = dict(request.args.to_dict())","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/datasets/datasets.py#L414-L450","documentation":"ValueError raised at line 432 when vector_type is non-None but matches neither the semantic_only set, the full_search set, nor the special MILVUS/TIDB_VECTOR branches. This indicates a vector type unknown to this helper's enumeration (likely a new/unsupported backend or a typo in config).","triggerScenarios":"Configuring VECTOR_STORE to a string that is not present in the VectorType StrEnum members handled by the helper (api/core/rag/datasource/vdb/vector_type.py lists supported names). E.g., a typo like 'qdrand', or a backend added to the enum but not yet wired into the retrieval-method sets.","commonSituations":"Typo in VECTOR_STORE env value; a newly added vector backend whose retrieval capabilities were not classified in semantic_only_types / full_search_types; mismatch between config casing and the StrEnum.","solutions":["Correct VECTOR_STORE to an exact VectorType member value (lowercase as defined in vector_type.py).","If the backend is legitimately supported, add it to semantic_only_types or full_search_types in the helper.","Confirm there is no leading/trailing whitespace or casing deviation in the env value."],"exampleFix":"# before\nVECTOR_STORE=Qdrant\n# after\nVECTOR_STORE=qdrant","handlingStrategy":"validation","validationCode":"from api.core.rag.datasource.vdb.vector_type import VectorType\n\ndef is_known_vector_type(v) -> bool:\n    try:\n        VectorType(v)\n        return True\n    except ValueError:\n        return False","typeGuard":"from api.core.rag.datasource.vdb.vector_type import VectorType\n\ndef is_supported_vector_type(v) -> bool:\n    return v in {m.value for m in VectorType}","tryCatchPattern":null,"preventionTips":["Use exact VectorType enum values in VECTOR_STORE (lowercase, no whitespace).","When adding a new backend, also classify it in the retrieval-method helper's sets.","Validate config at deploy time against the VectorType enum."],"tags":["vector-store","config","rag","value-error","unsupported"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}