{"record":{"id":"d4f6e97896464c55","repo":"chroma-core/chroma","slug":"tenant-user-provided-tenant-does-not-match-new","errorCode":null,"errorMessage":"Tenant {user_provided_tenant} does not match {new_tenant} from the server. Are you sure the tenant is correct?","messagePattern":"Tenant (.+?) does not match (.+?) from the server\\. Are you sure the tenant is correct\\?","errorType":"http","errorClass":"ChromaAuthError","httpStatus":403,"severity":"error","filePath":"chromadb/auth/utils/__init__.py","lineNumber":68,"sourceCode":"        new_database,\n    ) = _singleton_tenant_database_if_applicable(\n        user_identity=user_identity,\n        overwrite_singleton_tenant_database_access_from_auth=overwrite_singleton_tenant_database_access_from_auth,\n    )\n\n    # The only error case is if the user provides a tenant and database that\n    # don't match what we resolved from auth. This can incorrectly happen when\n    # there is no auth provider set, but overwrite_singleton_tenant_database_access_from_auth\n    # is set to True. In this case, we'll resolve tenant/database to the default\n    # values, which might not match the provided values. Thus, it's important\n    # to ensure that the flag is set to True only when there is an auth provider.\n    if (\n        user_provided_tenant\n        and user_provided_tenant != DEFAULT_TENANT\n        and new_tenant\n        and new_tenant != user_provided_tenant\n    ):\n        raise ChromaAuthError(f\"Tenant {user_provided_tenant} does not match {new_tenant} from the server. Are you sure the tenant is correct?\")\n    if (\n        user_provided_database\n        and user_provided_database != DEFAULT_DATABASE\n        and new_database\n        and new_database != user_provided_database\n    ):\n        raise ChromaAuthError(f\"Database {user_provided_database} does not match {new_database} from the server. Are you sure the database is correct?\")\n\n    if (\n        not user_provided_tenant or user_provided_tenant == DEFAULT_TENANT\n    ) and new_tenant:\n        user_provided_tenant = new_tenant\n    if (\n        not user_provided_database or user_provided_database == DEFAULT_DATABASE\n    ) and new_database:\n        user_provided_database = new_database\n\n    return user_provided_tenant, user_provided_database","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/auth/utils/__init__.py#L50-L86","documentation":"Error \"Tenant {user_provided_tenant} does not match {new_tenant} from the server. Are you sure the tenant is correct?\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/auth/utils/__init__.py:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}