AWS Lambdas: “Process exited before completing request”

While testing a React frontend for my SudokuSolver Lambda, I kept getting this error when calling the Lambda using superagent from React:

RequestId: 35934232-xxx Process exited before completing request

Testing from Postman it completed as expected.

This error message means what it says, the Lambda quit before it completed executing.

There are 2 possible paths through my SudokuSolver:

  1. The input puzzle has a single, unique solution
  2. The input has more than one possible solution

If there is more than one solution, the Solver finds the first solution and then exits. Yes, it does a System.exit(). There’s the cause of my problem. I was testing from Postman with a puzzle with a single solution, but the test from my React app only had a couple of values in the grid.

Lessons learned:

  • read and understand what the error message means. Once you understand what it’s telling you, ask how and where this applies to your code
  • when changing variable aspects of your test, don’t change too many at one time. If possible only make one change, so if something is unexpected you’ll know it’s as a result of that change (in my case I changed my test data from Postman to the React app and so wasn’t comparing the results with the same inputs. The issue was unrelated to React or superagent, it was completely related to my test data)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.