Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Multi-tenant: tenant deletion fails with DrizzleQueryError — transaction aborted (Postgres) #14576

@TomSteer

Description

@TomSteer

Describe the Bug

Deleting a tenant in the multi-tenant plugin using the Postgres adapter fails. A Drizzle/Postgres error aborts the transaction.

{
  "type": "DrizzleQueryError",
  "message": "Failed query: delete from \"payload_preferences\" where \"payload_preferences\".\"key\" in ($1)\nparams: collection-tenants-3: current transaction is aborted, commands ignored until end of transaction block"
}

Link to the code that reproduces this issue

https://github.com/payloadcms/payload/tree/main/examples/multi-tenant

Reproduction Steps

  1. Clone the multi-tenant example.
  2. Configure the example to use Postgres (set DATABASE_URL to a Postgres DB) so @payloadcms/db-postgres is used.
  3. Start the project and log in to the admin.
  4. Create a tenant.
  5. Attempt to delete the tenant via the admin UI.
  6. Observe the delete fails and the transaction is aborted.

Which area(s) are affected? (Select all that apply)

plugin: multi-tenant, db: postgres

Environment Info

payload: 3.63.0
@payloadcms/plugin-multi-tenant: 3.63.0
@payloadcms/db-postgres: 3.63.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions