{"record":{"id":"82fc621c0da9fe71","repo":"mem0ai/mem0","slug":"cluster-url-must-be-provided","errorCode":null,"errorMessage":"'cluster_url' must be provided.","messagePattern":"'cluster_url' must be provided\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/configs/vector_stores/weaviate.py","lineNumber":23,"sourceCode":"\nclass WeaviateConfig(BaseModel):\n    from weaviate import WeaviateClient\n\n    WeaviateClient: ClassVar[type] = WeaviateClient\n\n    collection_name: str = Field(\"mem0\", description=\"Name of the collection\")\n    embedding_model_dims: int = Field(1536, description=\"Dimensions of the embedding model\")\n    cluster_url: Optional[str] = Field(None, description=\"URL for Weaviate server\")\n    auth_client_secret: Optional[str] = Field(None, description=\"API key for Weaviate authentication\")\n    additional_headers: Optional[Dict[str, str]] = Field(None, description=\"Additional headers for requests\")\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def check_connection_params(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n        cluster_url = values.get(\"cluster_url\")\n\n        if not cluster_url:\n            raise ValueError(\"'cluster_url' must be provided.\")\n\n        return values\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n        allowed_fields = set(cls.model_fields.keys())\n        input_fields = set(values.keys())\n        extra_fields = input_fields - allowed_fields\n\n        if extra_fields:\n            raise ValueError(\n                f\"Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)}\"\n            )\n\n        return values\n\n    model_config = ConfigDict(arbitrary_types_allowed=True)","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/weaviate.py#L5-L41","documentation":"WeaviateConfig's `before` validator requires a truthy 'cluster_url' value; the field is Optional[str] with default None, so omitting it, passing None, or passing an empty string triggers this ValueError at config construction. This mirrors the weaviate-client requirement for an explicit endpoint (Weaviate has no discovery mechanism).","triggerScenarios":"Memory(vector_store={'provider': 'weaviate'}) with no config.cluster_url; passing cluster_url='' or None; passing the URL under a different key (url, host) which then also trips the extra-fields validator.","commonSituations":"Assuming WEAVIATE_URL is read from the environment (this config requires it explicitly); embedding Weaviate locally (embedded options) and not realizing this config still demands a URL; URL kept in a .env that was never loaded.","solutions":["Pass cluster_url explicitly: config={'cluster_url': 'https://my-cluster.weaviate.network'} or 'http://localhost:8080' for local Weaviate","Load it from your environment when building the config: cluster_url=os.environ['WEAVIATE_URL']","Double-check the key is exactly 'cluster_url' — 'url'/'host' are rejected"],"exampleFix":"# before\nconfig = {}\n\n# after\nconfig = {\"cluster_url\": \"http://localhost:8080\", \"auth_client_secret\": None}","handlingStrategy":"validation","validationCode":"if not cfg.get(\"cluster_url\"):\n    raise ConfigError(\"weaviate config requires cluster_url (e.g. http://localhost:8080)\")","typeGuard":null,"tryCatchPattern":"try:\n    memory = Memory(config=full_config)\nexcept ValueError as e:\n    if \"cluster_url\" in str(e):\n        cfg[\"cluster_url\"] = os.environ[\"WEAVIATE_URL\"]\n        memory = Memory(config=full_config)\n    else:\n        raise","preventionTips":["Pass cluster_url explicitly, sourcing it from your own env var at config-build time","For local Weaviate, standardize on http://localhost:8080 unless authentication is enabled"],"tags":["weaviate","vector-store","config","validation"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}