{"record":{"id":"79e893c53cddee2a","repo":"mem0ai/mem0","slug":"extra-fields-not-allowed-join-extra-fields-79e893","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/supabase.py","lineNumber":41,"sourceCode":"    embedding_model_dims: Optional[int] = Field(1536, description=\"Dimensions of the embedding model\")\n    index_method: Optional[IndexMethod] = Field(IndexMethod.AUTO, description=\"Index method to use\")\n    index_measure: Optional[IndexMeasure] = Field(IndexMeasure.COSINE, description=\"Distance measure to use\")\n\n    @model_validator(mode=\"before\")\n    def check_connection_string(cls, values):\n        conn_str = values.get(\"connection_string\")\n        if not conn_str or not conn_str.startswith(\"postgresql://\"):\n            raise ValueError(\"A valid PostgreSQL connection string must be provided\")\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=False)\n","sourceCodeStart":23,"sourceCodeEnd":47,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/configs/vector_stores/supabase.py#L23-L47","documentation":"SupabaseConfig runs a strict extra-fields validator that rejects any config key outside its declared set (connection_string, collection_name, embedding_model_dims, index_method, index_measure). Together with check_connection_string it forms a two-stage `before` validation: unknown keys and bad connection strings both fail fast, before any DB connection is attempted.","triggerScenarios":"Passing keys like host, port, user, password, or table_name in the supabase vector store config; passing an 'api_key' or Supabase URL; any key copied from another provider's config template.","commonSituations":"Splitting a postgresql:// URL into host/port/user/password components (this config wants the single connection_string); assuming a Supabase service-role key is needed here; using a pgvector-style config from the mem0 'postgres' provider example.","solutions":["Reduce the config to the allowed fields: connection_string, collection_name, embedding_model_dims, index_method, index_measure","Assemble host/port/user/password into one postgresql:// connection string instead of separate keys","Check for typos against the allowed list printed in the error message"],"exampleFix":"# before\nconfig = {\"connection_string\": \"postgresql://...\", \"host\": \"db.xyz.supabase.co\", \"user\": \"postgres\"}\n\n# after\nconfig = {\"connection_string\": \"postgresql://postgres:pass@db.xyz.supabase.co:5432/postgres\", \"collection_name\": \"mem0\"}","handlingStrategy":"validation","validationCode":"from mem0.configs.vector_stores.supabase import SupabaseConfig\nextra = set(cfg) - set(SupabaseConfig.model_fields)\nif extra:\n    raise ConfigError(f\"remove extra supabase config keys: {sorted(extra)}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive allowed keys from SupabaseConfig.model_fields rather than remembering them","Keep host/port/user/password inside the single connection_string"],"tags":["pydantic","supabase","vector-store","config","validation"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}