~/aws/31-troubleshoot-aws-lambda-unknown-error.md

Troubleshoot AWS Lambda unknown error!

1 min readAugust 22, 2017by Gorav Singal#aws#aws-lambda-function#debug-lambda
// TL;DR

If your Lambda silently dies with no error, check the timeout setting. Lambda kills the process when it exceeds the configured timeout, with no exception trace — just a silent stop.

Troubleshoot AWS Lambda unknown error!

After 2 days, there was my demo. I deployed my nodejs code on lambda function, and trying testing it. It abruptly stops in between, and no error or exception trace.

My application looked suspicious. I looked at my code, all looked good. I put a new try-catch statement, and some promised catch blocks. Deployed it again. Same behavior.

I started blaming newly developed components. Few days back, I incorporated newrelic components. I tried lot of modifications, debug statements, and even removed this component. But, still problem persists.

I tried running same application from my machine, it worked well. I wonder what is going on. I even thought of spinning an AWS EC2 instance, and try it there.

Problem

Each time, my application runs, and it stopped at one line only, with no trace, or error message. Troubleshoot AWS Lambda unknown error!

I was scanning through the configurations of lambda function. Suddenly, I found that the execution time value of lambda function was set to 1 min only.

Holy Crap!

I increased that time, and deployed my application again, it worked. My bad.

Tip for Lambda debugging

Always check lambda timeout value.

But

AWS people should show something in logs indicating that the app is shutting down due to timeout. It irked me a lot.

$ subscribe --weekly

One deep dive a week, in your inbox

System design, AI engineering, trading systems and interview prep. Tested code, real numbers. Free, and you can unsubscribe any time.

or read it on gyanbyte.substack.com

Share

Related Posts

Python SMTP Email Code - Sender Address Rejected - Not Owned By User

Python SMTP Email Code - Sender Address Rejected - Not Owned By User

Introduction In a normal email sending code from python, I’m getting following…

How to upload files on AWS S3 by using curl, without having command line aws or other tool

How to upload files on AWS S3 by using curl, without having command line aws or other tool

Introduction There were few files that I need to take backup from a machine that…

Static Website Hosting with AWS S3 and Cloudflare

Static Website Hosting with AWS S3 and Cloudflare

Static websites have several advantages over dyanamic websites. If you are…

Fix Drupal MySQL Error: Got a Packet Bigger Than max_allowed_packet

Fix Drupal MySQL Error: Got a Packet Bigger Than max_allowed_packet

Introduction While this topic may applicable to all mysql/mariadb users who…

Solving Jboss Wildfly Oracle JDBC driver problem, with Dockerfile

Solving Jboss Wildfly Oracle JDBC driver problem, with Dockerfile

Assuming your web application is using oracle, and you are deploying your app on…

React JS router not working on Nginx docker container

React JS router not working on Nginx docker container

Problem Statement I developed a simple ReactJS application where I have used…

Latest Posts

How to Stay Valuable as a Software Engineer in the AI Era: A Practical Playbook

How to Stay Valuable as a Software Engineer in the AI Era: A Practical Playbook

In the previous article I argued that AI is not killing software engineering…

How to Review AI-Generated Code: A Checklist for Catching What the Model Missed

How to Review AI-Generated Code: A Checklist for Catching What the Model Missed

A few months back I approved a PR that was almost entirely AI-generated. It…

How to Debug AI-Generated Code: Understand First, Fix Last

How to Debug AI-Generated Code: Understand First, Fix Last

In the last article I wrote about reviewing AI code before it goes in. This one…

The Future of Software Engineering: What AI Changes, What Stays, and Where the Jobs Go

The Future of Software Engineering: What AI Changes, What Stays, and Where the Jobs Go

Every few weeks somebody sends me a scary headline — “AI will replace all…

The Transactional Outbox Pattern: Never Lose an Event Again

The Transactional Outbox Pattern: Never Lose an Event Again

This is one of those patterns that looks like nothing until you get burnt once…

Event Sourcing, Explained: Store What Happened, Not Just the Final State

Event Sourcing, Explained: Store What Happened, Not Just the Final State

Here is a question I like to ask in interviews: your bank account shows a…