Erroneous warning for lambda timeout maximum value

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):

provider:
  name: aws
  timeout: 29

And I get the following warning when deploying:

 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.
1 Like

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

To avoid the warning as of 3/16/2020, downgrade to 1.6.5, or wait for the pull request #7467 to be merged.

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.'

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