{"record":{"id":"7f6ed5d309ab2677","repo":"mem0ai/mem0","slug":"extra-fields-not-allowed-join-extra-fields-7f6ed5","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/baidu.py","lineNumber":22,"sourceCode":"\n\nclass BaiduDBConfig(BaseModel):\n    endpoint: str = Field(\"http://localhost:8287\", description=\"Endpoint URL for Baidu VectorDB\")\n    account: str = Field(\"root\", description=\"Account for Baidu VectorDB\")\n    api_key: str = Field(None, description=\"API Key for Baidu VectorDB\")\n    database_name: str = Field(\"mem0\", description=\"Name of the database\")\n    table_name: str = Field(\"mem0\", description=\"Name of the table\")\n    embedding_model_dims: int = Field(1536, description=\"Dimensions of the embedding model\")\n    metric_type: str = Field(\"L2\", description=\"Metric type for similarity search\")\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":4,"sourceCodeEnd":28,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/baidu.py#L4-L28","documentation":"Raised by the Baidu vector store config's strict extra-fields validator. Only keys matching declared model fields are accepted; anything else aborts validation with a message listing both the offending keys and the full allowed set. This is a closed-schema guard against typo'd or unsupported options.","triggerScenarios":"Instantiating BaiduConfig with any key not in its declared fields (e.g. an unexpected 'region', 'timeout', or a field belonging to another vector store provider).","commonSituations":"Porting a config from another provider (qdrant, milvus) into the baidu section; using an option that was renamed or removed in a mem0 upgrade; hand-writing config dicts from memory instead of docs.","solutions":["Delete the extra key(s) named in the error","Cross-check remaining keys against the allowed-fields list included in the error text","Keep provider configs in separate dicts per provider rather than one shared dict passed everywhere","After upgrading mem0, re-validate all vector store configs in a smoke test"],"exampleFix":"# before\nBaiduConfig(api_key=\"k\", database_name=\"mem0\", table_name=\"mem0\", replica_count=3)\n\n# after\nBaiduConfig(api_key=\"k\", database_name=\"mem0\", table_name=\"mem0\")","handlingStrategy":"validation","validationCode":"from mem0.configs.vector_stores.baidu import BaiduConfig\ndef prune_baidu_extra(cfg: dict) -> dict:\n    extra = set(cfg) - set(BaiduConfig.model_fields)\n    if extra:\n        raise RuntimeError(f\"Unexpected baidu keys: {sorted(extra)}\")\n    return cfg","typeGuard":"def baidu_keys_valid(cfg: dict) -> bool:\n    return not (set(cfg) - set(BaiduConfig.model_fields))","tryCatchPattern":"from pydantic import ValidationError\ntry:\n    BaiduConfig(**cfg)\nexcept ValidationError as e:\n    if \"Extra fields not allowed\" in str(e):\n        # fix keys per the allowed list in the message\n        ...","preventionTips":["Write provider-specific config dicts, never reuse another provider's","Check the allowed-fields list printed in the error before retrying","Pin mem0 version and store configs alongside the pin"],"tags":["pydantic","configuration","vector-store","baidu","strict-schema"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}