Deleting a User from a Custom Database with Import Mode OFF
Last Updated:
Overview
This article addresses an error that occurs when an attempt to delete a user from a Custom Database fails. The issue is present when the database connection is configured with Import Mode OFF. The following error message is displayed:
There was a problem deleting <user-email>
Applies To
- Custom Database
Cause
When Import Mode is set to off, the connection uses the legacy database as the primary user store. The user account remains in the legacy database and is not migrated. As a result, explicit instructions in the form of Action Scripts are required for all user management operations, including deletion. The error occurs because the Delete Action Script has not been configured for the Custom Database connection. For more information, see Legacy authentication scenario and Custom Database Action Script Templates.
Solution
Configure the Delete Action Script to delete the user from the Custom Database.
-
Add a Delete script that connects to the legacy database and deletes the user from that source. Refer to the available Delete Script Templates for guidance.
-
Ensure the script includes the correct callback function to indicate the operation's status.
-
If the user deletion from the legacy database is successful, the script must return a null callback:
return callback(null);-
If the user deletion fails, the script must return an error:
return callback(new Error("My custom error message.")); -