{"record":{"id":"425ae6b13c5ff31a","repo":"mem0ai/mem0","slug":"extra-fields-not-allowed-join-extra-fields-425ae6","errorCode":null,"errorMessage":"Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)}","messagePattern":"Extra fields not allowed: (.+?)\\. Please input only the following fields: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mem0/configs/vector_stores/redis.py","lineNumber":19,"sourceCode":"from typing import Any, Dict\n\nfrom pydantic import BaseModel, ConfigDict, Field, model_validator\n\n\n# TODO: Upgrade to latest pydantic version\nclass RedisDBConfig(BaseModel):\n    redis_url: str = Field(..., description=\"Redis URL\")\n    collection_name: str = Field(\"mem0\", description=\"Collection name\")\n    embedding_model_dims: int = Field(1536, description=\"Embedding model dimensions\")\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        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        return values\n\n    model_config = ConfigDict(arbitrary_types_allowed=True)\n","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/redis.py#L1-L25","documentation":"RedisDBConfig is a Pydantic model whose `before` model_validator rejects any input key that is not one of the declared fields (redis_url, collection_name, embedding_model_dims). The error message lists the offending keys and the allowed set. It exists to catch typos and stale option names before the Redis client is constructed.","triggerScenarios":"Instantiating Memory with vector_store={'provider': 'redis', 'config': {...}} where the config dict contains any key outside redis_url/collection_name/embedding_model_dims — e.g. a copied-over 'host'/'port', 'password', 'db', or 'user' key from another store's config.","commonSituations":"Copying a config block from a Qdrant/Chroma/FAISS example and leaving foreign keys in it; upgrading mem0 versions where a Redis option was renamed or removed; passing auth fields directly instead of embedding them in redis_url.","solutions":["Remove the extra keys listed in the error message so the config dict contains only redis_url, collection_name, embedding_model_dims","Move credentials into the URL: redis_url='redis://:password@host:6379/0' instead of separate password/host fields","Rename a mistyped key to the exact allowed name shown in the 'Please input only the following fields' list"],"exampleFix":"# before\nconfig = {\"redis_url\": \"redis://localhost:6379\", \"host\": \"localhost\", \"password\": \"secret\"}\n\n# after\nconfig = {\"redis_url\": \"redis://:secret@localhost:6379/0\", \"collection_name\": \"mem0\", \"embedding_model_dims\": 1536}","handlingStrategy":"validation","validationCode":"ALLOWED = {\"redis_url\", \"collection_name\", \"embedding_model_dims\"}\nextra = set(cfg) - ALLOWED\nif extra:\n    raise ConfigError(f\"Unsupported redis config keys: {extra}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build vector store configs from the model's field list: set(RedisDBConfig.model_fields) instead of hand-writing dicts","Keep a reviewed config dict per provider in one module so foreign keys never leak in from copy-paste"],"tags":["pydantic","redis","vector-store","config","validation"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}