81

Lambda function showing the below error in test when changing file format from png to text

"errorMessage": "2020-07-17T07:06:45.969Z b66dd037-ba01-4025-97db-6527b486eac8 Task timed out after 3.00 seconds"
Chris Williams
  • 32,215
  • 4
  • 30
  • 68
eagletech
  • 821
  • 1
  • 5
  • 4

3 Answers3

139

I have same error - increasing the timeout resolved it:

In the AWS Management Console:

lambda function -> configuration -> General configuration -> Edit Timeout

enter image description here

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
Justin Joseph
  • 3,001
  • 1
  • 12
  • 16
24

The default Lambda timeout is 3 seconds.

To resolve this do one of the following:

  • Increase the timeout of your Lambda function, it can be upto 15 minutes. The recommendation would be to set it to the duration of how long you anticipate it will take.
  • Increase the resources (memory/CPU) so that your function is quicker at performing its target action.
Chris Williams
  • 32,215
  • 4
  • 30
  • 68
1

I was facing similar issue, tried with increasing memory and timeout value too, but not worked.

Problem is with booting the lambda function into the memory. So I moved a bigger dependency inside the functional call. For me its urllib dependency.

As Python import dependency works at runtime so booting lambda function worked without any load/lag.

hitesh bedre
  • 459
  • 2
  • 11