# Request to Webtask exceeded allowed execution time

**URL:** <https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time/88742>\
**Category:** Get Help\
**Tags:** mongodb\
**Created:** [August 14, 2022, 9:26pm UTC](https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time/88742 "2022-08-14T21:26:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![48nes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/48nes/32/39329_2.png) [@48nes](https://community.auth0.com/u/48nes)\
**Post date:** [August 14, 2022, 9:26pm UTC](https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time/88742/1 "2022-08-14T21:26:33Z")

</div>

I’m getting the “Request to Webtask exceeded allowed execution time” error when trying to use a custom database with mongodb.

I’ve downloaded the [Real Time Webtask Logs](https://auth0.com/docs/extensions/real-time-webtask-logs) extension and I keep getting a UnhandledPromiseRejectionWarning with the message TypeError [ERR\_INVALID\_ARG\_TYPE]: The “url” argument must be of type string. Received undefined.

I think it’s because I’ve been trying to use the configuration variables for database settings; I currently have a key DB\_URL set to my database’s URL. I have tried putting the URL in quotations and not in quotations and both times I get the same error. Everything else I have been using the default mongodb template that auth0 has provided.

EDIT: Forgot to mention, but I had to delete the @3.1.4 from require(‘mongodb’).

---

<div class="post-metadata">

**Author:** ![48nes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/48nes/32/39329_2.png) [@48nes](https://community.auth0.com/u/48nes)\
**Post date:** [August 14, 2022, 9:28pm UTC](https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time/88742/2 "2022-08-14T21:28:31Z")

</div>

Ok, now it seems like the issue is with the connection string. I think auth0 might be using an older version of MongoClient that only accepts connection strings that start ONLY with mongodb://. However, this isn’t possible for me as I need the mongodb+srv:// starter. Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![thameera](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thameera/32/13430_2.png) [@thameera](https://community.auth0.com/u/thameera)\
**Post date:** [August 15, 2022, 5:11am UTC](https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time/88742/3 "2022-08-15T05:11:04Z")

</div>

It’s likely the default version used when you do `require('mongodb')` is old and doesn’t support the scheme. It should work with 3.1.4 though - any particular reason you deleted the `@3.1.4` part?

The available NPM module versions in custom DB scripts can be found here: [https://auth0-extensions.github.io/canirequire/#mongodb](https://auth0-extensions.github.io/canirequire/#mongodb)  
I would encourage pinning the version with an `@` since the default version can change in the future causing the script to potentially break.

---

<div class="post-metadata">

**Author:** ![48nes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/48nes/32/39329_2.png) [@48nes](https://community.auth0.com/u/48nes)\
**Post date:** [August 15, 2022, 12:38pm UTC](https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time/88742/4 "2022-08-15T12:38:38Z")

</div>

When using the 3.1.4 part, I would get the error “The server is being accessed through a load balancer, but this driver does not have load balancing enabled”

---

<div class="post-metadata">

**Author:** ![48nes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/48nes/32/39329_2.png) [@48nes](https://community.auth0.com/u/48nes)\
**Post date:** [August 15, 2022, 2:13pm UTC](https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time/88742/5 "2022-08-15T14:13:07Z")

</div>

Using mongodb@4.1.0 fixes things.

---

<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:** [November 4, 2022, 2:59pm UTC](https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time/88742/6 "2022-11-04T14:59:49Z")

</div>


