langgenius/dify · error · ValueError

Vector store type is not configured.

Error message

Vector store type is not configured.

What it means

ValueError raised by the retrieval-methods helper (used to advertise supported search modes) when vector_type is None. The vector store type comes from dify_config.VECTOR_STORE; a None means the deployment never configured a vector database, so retrieval capabilities cannot be determined.

Source

Thrown at api/controllers/console/datasets/datasets.py:372

)


def _get_retrieval_methods_by_vector_type(vector_type: str | None, is_mock: bool = False) -> dict[str, list[str]]:
    """
    Get supported retrieval methods based on vector database type.

    Args:
        vector_type: Vector database type, can be None
        is_mock: Whether this is a Mock API, affects MILVUS handling

    Returns:
        Dictionary containing supported retrieval methods

    Raises:
        ValueError: If vector_type is None or unsupported
    """
    if vector_type is None:
        raise ValueError("Vector store type is not configured.")

    # Define vector database types that only support semantic search
    semantic_only_types = {
        VectorType.RELYT,
        VectorType.CHROMA,
        VectorType.PGVECTO_RS,
        VectorType.VIKINGDB,
        VectorType.UPSTASH,
    }

    # Define vector database types that support all retrieval methods
    full_search_types = {
        VectorType.QDRANT,
        VectorType.WEAVIATE,
        VectorType.OPENSEARCH,
        VectorType.ANALYTICDB,
        VectorType.MYSCALE,
        VectorType.ORACLE,

View on GitHub (pinned to ef8544b173)

Solutions

  1. Set VECTOR_STORE in the environment (e.g., VECTOR_STORE=weaviate, qdrant, milvus, pgvector) and restart.
  2. Verify the value loads: check dify_config.VECTOR_STORE at runtime in a shell.
  3. For Docker, ensure docker/.env or the matching docker/envs/*.env.example defines VECTOR_STORE.

Example fix

# before
# .env (VECTOR_STORE missing)
# after
VECTOR_STORE=weaviate
Defensive patterns

Strategy: validation

Validate before calling

from configs import dify_config

def vector_store_configured() -> bool:
    return getattr(dify_config, "VECTOR_STORE", None) is not None

Type guard

def has_vector_store(cfg) -> bool:
    return getattr(cfg, "VECTOR_STORE", None) not in (None, "")

Prevention

When it happens

Trigger: Any code path (e.g., GET /datasets retrieving supported retrieval methods, or dataset creation/validation flows) calling the helper while dify_config.VECTOR_STORE is unset/None. Typically surfaces when the environment lacks VECTOR_STORE configuration.

Common situations: Fresh deployment missing VECTOR_STORE in .env / docker env; misconfigured config parser returning None; test environment that did not set the variable.

Related errors


AI-assisted analysis of langgenius/dify@ef8544b173 (2026-08-12). Data as JSON: /api/errors/e1d3bae972bfaef7. Report an issue: GitHub.