# Custom database connection: Create script triggers "Invalid email" error

**URL:** <https://community.auth0.com/t/custom-database-connection-create-script-triggers-invalid-email-error/11103>\
**Category:** Get Help\
**Tags:** create-user, custom-database\
**Created:** [April 24, 2018, 3:14am UTC](https://community.auth0.com/t/custom-database-connection-create-script-triggers-invalid-email-error/11103 "2018-04-24T03:14:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alain](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Alain](https://community.auth0.com/u/Alain)\
**Post date:** [April 24, 2018, 3:14am UTC](https://community.auth0.com/t/custom-database-connection-create-script-triggers-invalid-email-error/11103/1 "2018-04-24T03:14:03Z")

</div>

I have a custom database connection whose “Create” script which triggers the _[Error] Invalid email_ error. This error is not generated by my script. To make sure of it, I reduce the script to a simple:

```
function create(user, callback){
     return callback(null);
}

```

So in theory, regardless the input, I should not have any error and the script does nothing. But the error persists. Tested email were of all kinds: dummy ([a@a.com](mailto:a@a.com)) or real emails.

Strangely enough, I create a new database connection and copy paste the login and create scripts. When trying with “Try connection” (as username is required, I cannot use the “try” functionality), it works well. However, I cannot delete my production database connection and recreate it ☹

I tried to search all over the web but I don’t know where this _Invalid email_ error comes from especially considering the fact that even real emails are rejected

---

<div class="post-metadata">

**Author:** ![Alain](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Alain](https://community.auth0.com/u/Alain)\
**Post date:** [April 24, 2018, 6:32am UTC](https://community.auth0.com/t/custom-database-connection-create-script-triggers-invalid-email-error/11103/2 "2018-04-24T06:32:47Z")

</div>

My apologies, I found out the root cause: the _GetUser_ script did raise an error when an user is not found instead of returning `callback(null);` and it appears that after signup, the _GetUser_ script is called out before _Create_ script.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 17, 2018, 10:58am UTC](https://community.auth0.com/t/custom-database-connection-create-script-triggers-invalid-email-error/11103/3 "2018-12-17T10:58:47Z")

</div>


