When your function results in 4xx response codes, Lambda registers the invocation as an error and may retry. There are many reasons this might happen, including:
These errors are caused by errors in your code. Logs can be extremely helpful in diagnosing these issues. Lambda stores any logs your function may emit to Cloudwatch Logs. Dead letter queues can also be very helpful because they allow you to look at failed event payloads.
When events are sent asynchronously to lambda, any event that fails twice will be sent to a configured dead letter queue. However, if there are any errors sending the event payload to the dead letter queue, Cloudwatch registers a dead letter error. Blue Matador monitors this metric so you don’t miss this important situation. If your function is producing dead letter errors, it may be possible that there are any of the following: