Auth0 Connection Creation Fails with "A connection with the same name is being deleted, try again later" Error
Customers attempting to create or deploy a database connection using the Management API, Auth0 Deploy CLI tool, or the Auth0 Dashboard may encounter an error message indicating that a connection with the same name is currently being deleted. This issue blocks deployment pipelines and manual connection creation. The error message observed is:
Error! A connection with the same name is being deleted, try again later
or
ManagementApiError: A connection with the same name is being deleted, try again later
This typically happens when a connection with the same name was recently deleted.
- Connections
The problem is caused by the asynchronous nature of database connection deletion in Auth0.
When a database connection is deleted, especially one with a large number of associated users, the process is not instantaneous. The users must be deleted first before the connection object itself is fully removed from the system. During this period, the connection is in a transitional "deleting" state, and the system prevents the creation of a new connection with the same name to avoid conflicts. Depending on the number of users, this cleanup process can take several hours.
The solution is to wait for the asynchronous deletion process of the previously deleted connection to fully complete.
- Since the full deletion of a database connection with many users can take several hours, it is necessary to wait before attempting to create it again.
- After waiting a reasonable amount of time (for example, a few hours), retry the action that failed.
- If immediate deployment is critical and waiting is not feasible, create a new database connection with a different name. This allows deployment to proceed without waiting for the cleanup of the previously deleted connection.