mem0ai/mem0 · error · ValueError
Extra fields not allowed: {', '.join(extra_fields)}. Please
Error message
Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)} What it means
WeaviateConfig runs the standard closed-set extra-fields validator: any config key outside {collection_name, embedding_model_dims, cluster_url, auth_client_secret, additional_headers} raises this error, with the rejected and allowed key names embedded in the message. It runs after check_connection_params, so a missing cluster_url surfaces first.
Source
Thrown at mem0/configs/vector_stores/weaviate.py:35
@model_validator(mode="before")
@classmethod
def check_connection_params(cls, values: Dict[str, Any]) -> Dict[str, Any]:
cluster_url = values.get("cluster_url")
if not cluster_url:
raise ValueError("'cluster_url' must be provided.")
return values
@model_validator(mode="before")
@classmethod
def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]:
allowed_fields = set(cls.model_fields.keys())
input_fields = set(values.keys())
extra_fields = input_fields - allowed_fields
if extra_fields:
raise ValueError(
f"Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)}"
)
return values
model_config = ConfigDict(arbitrary_types_allowed=True)
View on GitHub (pinned to 001c235229)
Solutions
- Map weaviate-client options to the model fields: API key goes to auth_client_secret, custom HTTP headers to additional_headers
- Delete any key not in the allowed list printed by the error
- Handle host/port by combining them into cluster_url='http://host:port'
Example fix
# before
config = {"cluster_url": "http://localhost:8080", "api_key": "my-key"}
# after
config = {"cluster_url": "http://localhost:8080", "auth_client_secret": "my-key"} Defensive patterns
Strategy: validation
Validate before calling
from mem0.configs.vector_stores.weaviate import WeaviateConfig
extra = set(cfg) - set(WeaviateConfig.model_fields)
if extra:
raise ConfigError(f"map/remove unknown weaviate keys: {sorted(extra)} (api_key -> auth_client_secret)") Prevention
- Translate weaviate-client option names to this model's fields before passing config
- Combine host/port into cluster_url rather than passing them separately
When it happens
Trigger: Passing keys like host, port, scheme, api_key, or timeout in the weaviate config dict; using the weaviate-client v3 constructor vocabulary (url, timeout_config) instead of this model's fields.
Common situations: Migrating code that built a weaviate_client.WeaviateClient directly and reusing its option names; assuming auth uses 'api_key' instead of 'auth_client_secret'; copying a config block from another provider.
Related errors
- Extra fields not allowed: {', '.join(extra_fields)}. Please
- Extra fields not allowed: {', '.join(extra_fields)}. Please
- A valid PostgreSQL connection string must be provided
- Extra fields not allowed: {', '.join(extra_fields)}. Please
- Extra fields not allowed: {', '.join(extra_fields)}. Please
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/da0bdacebcd4f6f4.
Report an issue: GitHub.