I have an AWS Lambda function hosted in an API Gateway. It was working fine earlier today, but now has started returning 404 Not Found
when I call the Invoke URL via the browser.
I have not made any changes to the application code, CDK, or pipelines.
The specific error on the page (where <unique_id>
is the prefix AWS prepends to the URL and <path_param>
is the path parameter my app is expecting) is:
This <unique_id>.execute-api.us-east-1.amazonaws.com page can’t be found
No webpage was found for the web address: https://<unique_id>.execute-api.us-east-1.amazonaws.com/prod/<path_param>
The Lambda was built as an ASP.NET Core Minimal API with Lambda hosting, as described here (2/3 the way down the page):
https://aws.amazon.com/blogs/compute/introducing-the-net-6-runtime-for-aws-lambda/
I verified that I copied the Invoke URL verbatim from the Stages section:
The browser console and Developer Tools Network tab don’t provide any additional information.
The CloudWatch logs aren’t informative either. The logs show that all my startup/dependency injection code works as expected. The error occurs sometime after the startup/dependency injection but before the flow enters my function method.
The only possible issue I see in the logs is the 2nd line, which reads:
/var/runtime/bootstrap: line 10: [: missing
]’`.
I’ve also verified that my Lambda code is successfully uploaded to the function after deployment.
Any idea what could be causing this, given that it was working fine before? It’s really baffling me.