# Erroneous warning for lambda timeout maximum value

**URL:** <https://forum.serverless.com/t/erroneous-warning-for-lambda-timeout-maximum-value/10749>\
**Category:** Serverless Framework\
**Tags:** lambda, api-gateway\
**Created:** [March 10, 2020, 10:18am UTC](https://forum.serverless.com/t/erroneous-warning-for-lambda-timeout-maximum-value/10749 "2020-03-10T10:18:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcohler](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gcohler/32/3187_2.png) [@gcohler](https://forum.serverless.com/u/gcohler)\
**Post date:** [March 10, 2020, 10:18am UTC](https://forum.serverless.com/t/erroneous-warning-for-lambda-timeout-maximum-value/10749/1 "2020-03-10T10:18:57Z")

</div>

I have started to receive warning messages recently for my timeout value of 29s (which should be legal). Is this a problem with Serverless? Or should I put something different in my serverless.yml file?

My serverless.yml file contains (among other things):

```auto
provider:
  name: aws
  timeout: 29

```

And I get the following warning when deploying:

```auto
 Serverless Warning --------------------------------------
 
  Function timeout setting (29) is greater than maximum allowed timeout for HTTP API endpoint (29s). This may introduce situation where endpoint times out for successful lambda invocation.

```

---

<div class="post-metadata">

**Author:** ![simsketch](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/simsketch/32/3940_2.png) [@simsketch](https://forum.serverless.com/u/simsketch)\
**Post date:** [March 16, 2020, 4:27pm UTC](https://forum.serverless.com/t/erroneous-warning-for-lambda-timeout-maximum-value/10749/2 "2020-03-16T16:27:24Z")

</div>

Getting the same warning after upgrading from Serverless 1.5.x to 1.6.6.0. Originally I had timeout: 30 but changed it to timeout: 29 and stil got the same error message.

Considering I need these 29 timeout lambdas to use the maximum time, I can probably just remove this line altogether and by default it will use the maximum timeout.

Edit: I was going to open an issue but it looks like one is open already. [https://github.com/serverless/serverless/issues/7440#issuecomment-598411665](https://github.com/serverless/serverless/issues/7440#issuecomment-598411665)

To avoid the warning as of 3/16/2020, downgrade to 1.6.5, or wait for the pull request [#7467](https://github.com/serverless/serverless/pull/7467) to be merged.

---

<div class="post-metadata">

**Author:** ![gcohler](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gcohler/32/3187_2.png) [@gcohler](https://forum.serverless.com/u/gcohler)\
**Post date:** [March 16, 2020, 10:52pm UTC](https://forum.serverless.com/t/erroneous-warning-for-lambda-timeout-maximum-value/10749/3 "2020-03-16T22:52:16Z")

</div>

I checked that PR – and I don’t think it will help me. It looks like the check is for \>=29s – so the timeout needs to be less than 29 – the message and the code don’t agree. So reducing the timeout setting to 28 should work.

```
if (functionTimeout >= 29) {
            logWarning(
              `Function timeout setting (${functionTimeout}) is greater than ` +
              `Function (${functionName}) timeout setting (${functionTimeout}) is greater than ` +
                'maximum allowed timeout for HTTP API endpoint (29s). ' +
                'This may introduce situation where endpoint times out ' +
                'for succesful lambda invocation.'
```

---

<div class="post-metadata">

**Author:** ![gcohler](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gcohler/32/3187_2.png) [@gcohler](https://forum.serverless.com/u/gcohler)\
**Post date:** [March 16, 2020, 11:03pm UTC](https://forum.serverless.com/t/erroneous-warning-for-lambda-timeout-maximum-value/10749/4 "2020-03-16T23:03:41Z")

</div>

I verified that 28 worked. Thanks very much for finding the PR – it helped me understand how the check was working.
