Support Forums

Increase function timeout from 10s to max of 26s


Please help us to increase function timeout from 10s to max of 26s on our team’s account sitewide.
We are on a pro plan,
Team name: Team BG
Slug: bg-git
Please let us know if you need anything else.

-Pavlo Poberezhets

hi there,
we have bumped you up to 26 secs! enjoy.

Hi Perry, Thanks for making the change. How do I know that the 26 secs setting is working? We are still getting the timeout error when connecting MongoDB in a function.
Please see the below error message and help me. Thanks.

8:28:42 AM: de3d8bb5 ERROR  Unhandled Promise Rejection 	{"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"MongoNetworkTimeoutError: connection timed out","reason":{"errorType":"MongoNetworkTimeoutError","errorMessage":"connection timed out","stack":["MongoNetworkTimeoutError: connection timed out","    at connectionFailureError (/var/task/node_modules/mongodb/lib/cmap/connect.js:295:20)","    at TLSSocket.<anonymous> (/var/task/node_modules/mongodb/lib/cmap/connect.js:267:22)","    at Object.onceWrapper (events.js:420:28)","    at TLSSocket.emit (events.js:314:20)","    at TLSSocket.Socket._onTimeout (net.js:483:8)","    at listOnTimeout (internal/timers.js:554:17)","    at processTimers (internal/timers.js:497:7)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: MongoNetworkTimeoutError: connection timed out","    at process.<anonymous> (/var/runtime/index.js:35:15)","    at process.emit (events.js:314:20)","    at processPromiseRejections (internal/process/promises.js:209:33)","    at processTicksAndRejections (internal/process/task_queues.js:98:32)"]}
8:28:42 AM: [ERROR] [1633523322215] LAMBDA_RUNTIME Failed to post handler success response. Http response code: 400.
8:28:42 AM: eeb0284d Duration: 9.89 ms	Memory Usage: 30 MB	8:28:42 AM: RequestId: eeb0284d-e3f7-4a08-b7aa-1293c4fdcb2c Error: Runtime exited with error: exit status 128

Hi @poberezhetspavlo,

That’s not lambda function’s timeout. It’s a connection timeout error that’s occurring when trying to connect to Mongo. I think you’d have to try and test if your connection settings are working correctly to connect to Mongo.

Yes, we have tested it and it works sometimes without the timeout error. but most likely it’s not working…

In that case, I think you’d have to ask Mongo for details on why a connection to their DB would time out. Netlify is trying to connect through Functions, but if the server doesn’t respond in time, the request fails.