# \[Custom Database\] Create script is never read (while all other scripts work)

**URL:** <https://community.auth0.com/t/custom-database-create-script-is-never-read-while-all-other-scripts-work/14367>\
**Category:** Get Help\
**Tags:** auth0-create-user, custom-database\
**Created:** [August 16, 2018, 8:24am UTC](https://community.auth0.com/t/custom-database-create-script-is-never-read-while-all-other-scripts-work/14367 "2018-08-16T08:24:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gahabeen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gahabeen/32/8392_2.png) [@gahabeen](https://community.auth0.com/u/gahabeen)\
**Post date:** [August 16, 2018, 8:24am UTC](https://community.auth0.com/t/custom-database-create-script-is-never-read-while-all-other-scripts-work/14367/1 "2018-08-16T08:24:17Z")

</div>

Hi there,

I’ve read the other topics on the subject and here is what I did already:

1. **took a new browser to refresh (cached scripts? contents?)** : It actually got one script working with this solution.
2. **added some console.logs to check out from the Test Script AND from the webtask console logs live output** : Helped me to see that only the **create** script isn’t working at all. There is a console.log on the first line and this isn’t even read 😕
3. **checked the scripts on local env and works like a charm**

Here is how my create script look:

```auto
function create(user, callback) {
  console.log("Calling create()");
  request({
      url: "https://endpoint.com/to/somewhere",
      method: "POST",
      body: { user },
      qs: { SECURE: configuration.SECURE_KEY },
      json: true
    },
    function(err, res, body) {
      if (body.ok) return callback(null, body.data);
      callback(err, res);
    }
  );
}

```

and this is the result:

 ![](https://global.discourse-cdn.com/auth0/original/2X/6/63f167899f5c534dfd0abe35a8d9135e077da392.png)

Any idea how to make it work?

Thanks for you help,  
Gabin

---

<div class="post-metadata">

**Author:** ![gahabeen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gahabeen/32/8392_2.png) [@gahabeen](https://community.auth0.com/u/gahabeen)\
**Post date:** [August 16, 2018, 2:34pm UTC](https://community.auth0.com/t/custom-database-create-script-is-never-read-while-all-other-scripts-work/14367/2 "2018-08-16T14:34:13Z")

</div>

After 2 days of research I finally got the issue… my **getUser** script when not finding any was sending back an error when the callback should be empty of arguments.

Meaning that you should return `callback()` when finding no existing user!

---

<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:30am UTC](https://community.auth0.com/t/custom-database-create-script-is-never-read-while-all-other-scripts-work/14367/3 "2018-12-17T10:30:55Z")

</div>


