Internal Server Error with Nested API Gateway Path Param

0

We're currently facing an issue involving AWS API Gateway and Lambda functions that has us scratching our heads.

We have an API endpoint configured as

https://api.blocktransfer.com/assets/{code}/balances

You can test this on your end with code DEMO.

Image of API Gateway route configuration

When making a call to this endpoint, instead of the expected output, we're encountering the following response:

{"message": "Internal Server Error"}

Our Lambda function appears to be configured correctly, and it's associated with the API Gateway route as expected.

Beginning of Lambda function code

We received the same result with dummy lambda functions returning just the handler event.

This is a public function with no user authentication.

We're looking forward to hearing your insights as we aim to resolve this issue. Thank you in advance for your help.

1 Answer
0
Accepted Answer

Have you tried testing the lambda on its own. You can create a test event using the apigateway-api-proxy or apigateway-http-api-proxy templates depending on whether your API is a REST or HTTP API. You don't have to fill out all of the parameters listed in the template just the ones needed for the successful invocation of the function. You can print to stdout or stderr using print() or the python logging library. You can then get some insight in the "Monitor" tab of the Lambda Console or look in CloudWatch for more details. Internal Server Error indicates that the error is most likely happening in the Lambda function. I would only introduce the API Gateway in the troubleshooting only after confirming that the Lambda is working as expected.

Let me know if you have any other question or concerns.

AWS
answered 6 months ago
  • Wrong integration - duplicate old function name

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions