{"record":{"id":"f0f172a3486e86fa","repo":"mem0ai/mem0","slug":"extra-fields-not-allowed-join-extra-fields-f0f172","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/cassandra.py","lineNumber":68,"sourceCode":"\n        # Either secure_connect_bundle or contact_points must be provided\n        if not secure_connect_bundle and not contact_points:\n            raise ValueError(\n                \"Either 'contact_points' or 'secure_connect_bundle' must be provided\"\n            )\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        \"\"\"Validate that no extra fields are provided.\"\"\"\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)}. \"\n                f\"Please input only the following fields: {', '.join(allowed_fields)}\"\n            )\n\n        return values\n\n    model_config = ConfigDict(arbitrary_types_allowed=True)\n\n","sourceCodeStart":50,"sourceCodeEnd":77,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/cassandra.py#L50-L77","documentation":"Raised by the Cassandra config's strict extra-fields validator. Any config key that is not a declared model field is rejected outright, with the error listing both the extras and the allowed fields. It is a typo/stale-option guard that runs before connection setup.","triggerScenarios":"Passing CassandraConfig keys like 'hosts', 'port', 'protocol_version', or any option not in its declared field set — e.g. using driver-level keywords instead of the model's names.","commonSituations":"Translating a raw cassandra-driver Cluster() kwargs dict into mem0 config without pruning; carrying over fields from another vector store's config; fields removed during a mem0 version bump still present in saved configs.","solutions":["Remove the extra key(s) identified in the error message","Map driver-level options to the supported fields; unsupported ones must be dropped","Compare your key set with the allowed list embedded in the error output","Keep configs version-pinned next to the mem0 release they were written for"],"exampleFix":"# before\nCassandraConfig(contact_points=[\"h\"], protocol_version=4, keyspace=\"mem0\")\n\n# after\nCassandraConfig(contact_points=[\"h\"], keyspace=\"mem0\")","handlingStrategy":"validation","validationCode":"from mem0.configs.vector_stores.cassandra import CassandraConfig\ndef prune_cassandra_extra(cfg: dict) -> dict:\n    extra = set(cfg) - set(CassandraConfig.model_fields)\n    if extra:\n        raise RuntimeError(f\"Unexpected cassandra keys: {sorted(extra)}\")\n    return cfg","typeGuard":"def cassandra_keys_valid(cfg: dict) -> bool:\n    return not (set(cfg) - set(CassandraConfig.model_fields))","tryCatchPattern":"from pydantic import ValidationError\ntry:\n    CassandraConfig(**cfg)\nexcept ValidationError as e:\n    if \"Extra fields not allowed\" in str(e):\n        # remove driver-level kwargs listed in the message\n        ...","preventionTips":["Do not pass raw cassandra-driver Cluster kwargs into mem0 config","Maintain a mapping of supported fields per provider","Re-run a config smoke test after mem0 upgrades"],"tags":["pydantic","configuration","vector-store","cassandra","strict-schema"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}