Skip to content

"message": "Not Found" result from Hello, World API Gateway API

0

Novice user. My goal is to write Lambda functions in Go and turn them into API Gateway APIs. I created a "Hello, World" Go executable and turned it into a Lambda. The Lambda test passed. I then built the default API Gateway API

  • Lambda integration with my working Lambda function
  • Defined a name
  • Default routes
  • Default stages
  • Create

Under Deploy/Stages I find my $default stage with a hyperlink URL. I click on the URL and get {"message":"Not Found"} I think these steps are minimal. I don't know what I can change. I don't know how to debug this.

2 Answers
0

Hi JTW! Based on the AWS documentation, if you're getting a {"message":"Not Found"} response from your API Gateway, here’s a step-by-step approach to troubleshoot and fix it:

  1. Lambda Function: Ensure your Lambda function is correctly set up to handle API Gateway requests. Check the example in documentation AWS guide on creating a REST API with Lambda proxy integration.

  2. API Gateway Configuration:

    • Make sure the API Gateway method is correctly integrated with your Lambda function.
    • Ensure you have deployed the changes to the $default stage or the correct named stage.
    • Check the endpoint path; if you are using $default, your URL should not include any additional path.
  3. Proxy Integration: If using Lambda proxy integration, confirm that your Lambda function can handle the input format that API Gateway sends. This usually means your Lambda handler should be able to parse JSON input.

  4. IAM Permissions: Verify that API Gateway has the correct permissions to invoke your Lambda function. You might need to check the resource-based policy attached to the Lambda function to allow API Gateway execution.

  5. Logs and Monitoring: Enable detailed logging in API Gateway and check CloudWatch logs for both API Gateway and Lambda to understand what is happening when the request is processed.

For more detailed information, refer to the AWS guide on creating a REST API with Lambda proxy integration. I'm here to help.

EXPERT
answered 2 years ago
  • Thank you for your response. I have spent some time with the documentation and will spend more time tomorrow. The challenge is that there is so much documentation, it may not be possible to have it all correct at one time. I worked through the example in 'Get started with API Gateway', which uses node.js for the Lambda. I got exactly the same problem. I expect that my root problem is IAM Permissions.

0

Verify Lambda Integration: Ensure your API Gateway is correctly integrated with the Lambda function.

Check Resources and Methods: Confirm that you have set up resources (e.g., /) and methods (e.g., GET) in API Gateway.

Deploy the API: Make sure you have deployed your API to the $default or appropriate stage.

Test Lambda Function: Test the Lambda function directly in the Lambda console to ensure it works.

Review API Gateway Stage Settings: Verify stage settings and ensure the deployment is up-to-date.

Enable CloudWatch Logs: Enable logging in API Gateway for detailed error insights.

Verify URL and Method: Check that you’re using the correct endpoint URL and HTTP method.

AWS
EXPERT
answered 2 years ago

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.