{"record":{"id":"09fc911ae984bc51","repo":"mem0ai/mem0","slug":"extra-fields-not-allowed-join-extra-fields-09fc91","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/chroma.py","lineNumber":53,"sourceCode":"        # Check if local/server configuration is provided\n        local_config = bool(path) or bool(host and port)\n        \n        if not cloud_config and not local_config:\n            raise ValueError(\"Either ChromaDB Cloud configuration (api_key, tenant) or local configuration (path or host/port) must be provided.\")\n        \n        if cloud_config and local_config:\n            raise ValueError(\"Cannot specify both cloud configuration and local configuration. Choose one.\")\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        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":35,"sourceCodeEnd":59,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/chroma.py#L35-L59","documentation":"Raised by ChromaDbConfig's strict extra-fields validator: any constructor key outside the declared model fields is rejected with a message listing the extras and the allowed set. It runs after the cloud/local checks, so a valid connection config can still fail on a typo'd key.","triggerScenarios":"Passing ChromaDbConfig keys like 'collection_metadata', 'anonymized_telemetry', 'settings', or any chromadb.PersistentClient kwarg that is not a declared field.","commonSituations":"Copying chromadb client settings into the mem0 config; leftover keys after renaming in a mem0 release; configs shared across providers accumulating stray keys.","solutions":["Remove the extra key(s) named in the error","Verify the surviving keys against the allowed list in the error message","Configure advanced chromadb options by passing your own 'client' instance instead of extra config keys","Re-check the field list for your installed mem0 version after upgrades"],"exampleFix":"# before\nChromaDbConfig(path=\"./db\", anonymized_telemetry=False)\n\n# after\nimport chromadb\nclient = chromadb.PersistentClient(path=\"./db\", anonymized_telemetry=False)\nChromaDbConfig(client=client)","handlingStrategy":"validation","validationCode":"from mem0.configs.vector_stores.chroma import ChromaDbConfig\ndef prune_chroma_extra(cfg: dict) -> dict:\n    extra = set(cfg) - set(ChromaDbConfig.model_fields)\n    if extra:\n        raise RuntimeError(f\"Unexpected chroma keys: {sorted(extra)}\")\n    return cfg","typeGuard":"def chroma_keys_valid(cfg: dict) -> bool:\n    return not (set(cfg) - set(ChromaDbConfig.model_fields))","tryCatchPattern":"from pydantic import ValidationError\ntry:\n    ChromaDbConfig(**cfg)\nexcept ValidationError as e:\n    if \"Extra fields not allowed\" in str(e):\n        # move unsupported options into a custom client instance\n        ...","preventionTips":["Pass advanced options via a self-built chromadb client, not config keys","Check keys against the error's allowed list","Smoke-test configs after mem0 upgrades"],"tags":["pydantic","configuration","vector-store","chroma","strict-schema"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}