{"record":{"id":"370be575e90c5bed","repo":"mem0ai/mem0","slug":"extra-fields-not-allowed-join-extra-fields-370be5","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/databricks.py","lineNumber":41,"sourceCode":"    collection_name: str = Field(\"mem0\", description=\"Vector search index name\")\n    index_type: VectorIndexType = Field(\"DELTA_SYNC\", description=\"Index type: DELTA_SYNC or DIRECT_ACCESS\")\n    embedding_model_endpoint_name: Optional[str] = Field(\n        None, description=\"Embedding model endpoint for Databricks-computed embeddings\"\n    )\n    embedding_dimension: int = Field(1536, description=\"Vector embedding dimensions\")\n    endpoint_type: EndpointType = Field(\"STANDARD\", description=\"Endpoint type: STANDARD or STORAGE_OPTIMIZED\")\n    pipeline_type: PipelineType = Field(\"TRIGGERED\", description=\"Sync pipeline type: TRIGGERED or CONTINUOUS\")\n    warehouse_name: Optional[str] = Field(None, description=\"Databricks SQL warehouse Name\")\n    query_type: str = Field(\"ANN\", description=\"Query type: `ANN` and `HYBRID`\")\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_validator(mode=\"after\")\n    def validate_authentication(self):\n        \"\"\"Validate that either access_token or service principal credentials are provided.\"\"\"\n        has_token = self.access_token is not None\n        has_service_principal = (self.client_id is not None and self.client_secret is not None) or (\n            self.azure_client_id is not None and self.azure_client_secret is not None\n        )\n\n        if not has_token and not has_service_principal:\n            raise ValueError(\n                \"Either access_token or both client_id/client_secret or azure_client_id/azure_client_secret must be provided\"\n            )\n\n        return self","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/databricks.py#L23-L59","documentation":"Raised by the Databricks vector store config's strict extra-fields validator. Every key passed to DatabricksConfig must match a declared model field; the difference set is rejected before authentication validation even runs. It is a closed-schema typo guard.","triggerScenarios":"Constructing DatabricksConfig with keys outside its field set — e.g. 'warehouse_id' vs the supported 'warehouse_name', 'catalog', or options copied from another provider's config.","commonSituations":"Databricks terminology drift (workspace URL keys, warehouse identifiers) mapped to guessed field names; configs inherited from a qdrant/milvus setup; field renames between mem0 versions.","solutions":["Remove or correct the extra key(s) listed in the error message","Use the exact declared names — check the allowed-fields list printed in the error","Confirm you are on a mem0 version whose DatabricksConfig supports the fields you need","Store Databricks options you cannot express as fields at the client level, not in the config dict"],"exampleFix":"# before\nDatabricksConfig(host=\"https://adb-...\", access_token=\"t\", warehouse_id=\"abc\")\n\n# after\nDatabricksConfig(host=\"https://adb-...\", access_token=\"t\", warehouse_name=\"my-warehouse\")","handlingStrategy":"validation","validationCode":"from mem0.configs.vector_stores.databricks import DatabricksConfig\ndef prune_databricks_extra(cfg: dict) -> dict:\n    extra = set(cfg) - set(DatabricksConfig.model_fields)\n    if extra:\n        raise RuntimeError(f\"Unexpected databricks keys: {sorted(extra)}\")\n    return cfg","typeGuard":"def databricks_keys_valid(cfg: dict) -> bool:\n    return not (set(cfg) - set(DatabricksConfig.model_fields))","tryCatchPattern":"from pydantic import ValidationError\ntry:\n    DatabricksConfig(**cfg)\nexcept ValidationError as e:\n    if \"Extra fields not allowed\" in str(e):\n        # rename to the declared field names listed in the message\n        ...","preventionTips":["Use exact declared field names (e.g. warehouse_name, not warehouse_id)","Validate against model_fields before construction","Version-pin mem0 and match configs to it"],"tags":["pydantic","configuration","vector-store","databricks","strict-schema"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}