{"record":{"id":"cfefacaf61756734","repo":"mem0ai/mem0","slug":"extra-fields-not-allowed-join-extra-fields-cfefac","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/s3_vectors.py","lineNumber":23,"sourceCode":"\nclass S3VectorsConfig(BaseModel):\n    vector_bucket_name: str = Field(description=\"Name of the S3 Vector bucket\")\n    collection_name: str = Field(\"mem0\", description=\"Name of the vector index\")\n    embedding_model_dims: int = Field(1536, description=\"Dimension of the embedding vector\")\n    distance_metric: str = Field(\n        \"cosine\",\n        description=\"Distance metric for similarity search. Options: 'cosine', 'euclidean'\",\n    )\n    region_name: Optional[str] = Field(None, description=\"AWS region for the S3 Vectors client\")\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":5,"sourceCodeEnd":29,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/s3_vectors.py#L5-L29","documentation":"S3VectorsConfig's `before` model_validator rejects any configuration key that is not a declared field (the S3 Vectors options: bucket name/arn, vector store name/arn, region_name, distance metric, embedding_model_dims, etc.). The message enumerates both the rejected keys and the full allowed set, so the fix is mechanical.","triggerScenarios":"Calling Memory with vector_store={'provider': 's3_vectors', 'config': {...}} where the config dict contains keys not declared on S3VectorsConfig — typical offenders are AWS credential keys (aws_access_key_id, aws_secret_access_key), profile, or keys copied from other vector store configs.","commonSituations":"Assuming AWS credentials belong in the vector store config (they belong in the environment, IAM roles, or the boto3 client passed separately); copying an example config for another provider; using a field name from an older mem0 release.","solutions":["Delete the extra keys named in the error so the dict only uses fields from the allowed list in the message","Supply AWS credentials via environment variables (AWS_ACCESS_KEY_ID etc.), an IAM role, or ~/.aws/credentials instead of the config dict","Check the S3VectorsConfig field declarations for the exact accepted names (e.g. region_name for the AWS region)"],"exampleFix":"# before\nconfig = {\"bucket_name\": \"my-bucket\", \"aws_access_key_id\": \"...\", \"aws_secret_access_key\": \"...\"}\n\n# after\nconfig = {\"bucket_name\": \"my-bucket\", \"region_name\": \"us-east-1\"}  # credentials from env/IAM","handlingStrategy":"validation","validationCode":"from mem0.configs.vector_stores.s3_vectors import S3VectorsConfig\nextra = set(cfg) - set(S3VectorsConfig.model_fields)\nassert not extra, f\"extra keys: {extra}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never put AWS credentials in the vector store config; use env vars or IAM roles","Validate config dicts against the Pydantic model before passing them to Memory"],"tags":["pydantic","aws","s3-vectors","vector-store","config","validation"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}