- Newest
- Most votes
- Most comments
To diagnose a Runtime.InvalidEntrypoint error in your Lambda function using a container image, I recommend checking the following:
-
Verify that your ENTRYPOINT in the Dockerfile includes the absolute path as the location. The error often occurs when the ENTRYPOINT is not properly specified or contains a symlink.
-
If you're using an AWS CloudFormation template, check if your container ENTRYPOINT is being overridden with a null or empty value. If you declare an ImageConfig resource in your template, you must provide non-empty values for all three properties.
-
For Python Lambda container images, ensure you have the correct ENTRYPOINT configuration. The base image from public.ecr.aws/lambda/python:3.12 should already have the proper ENTRYPOINT set up, but if you've modified it, that could cause issues.
-
Check your Dockerfile to ensure it includes both ENTRYPOINT and CMD directives. For Python Lambda functions, a typical configuration would be:
- ENTRYPOINT pointing to the Lambda runtime interface client
- CMD specifying your handler function (e.g., ["lambda_function.handler"])
-
If you're building a custom runtime, ensure that the bootstrap file exists and is executable. Lambda looks for this file at the root of your deployment package or in the function's layers.
-
Review your CloudWatch logs for additional error messages beyond the Runtime.InvalidEntrypoint error you shared, as there might be more detailed information about what's causing the issue.
-
If the image works locally but fails in Lambda, double-check that your local testing environment matches how Lambda would invoke the container.
Since the error is occurring despite the image working locally with 'docker run', the issue might be related to how Lambda is trying to invoke your function rather than the image architecture itself.
Sources
Troubleshoot invocation issues in Lambda - AWS Lambda
AWS Lambda: Runtime.InvalidEntrypoint | AWS re:Post
Building a custom runtime for AWS Lambda - AWS Lambda
As mentioned by repost agent, you need to define the entry point correctly. Here's an example.
FROM public.ecr.aws/lambda/python:3.12
# Copy function code
COPY app.py . # or your appropriate module
# Install dependencies (if any)
# RUN pip install -r requirements.txt
# Set handler
CMD ["app.lambda_handler"]
Assuming the handler is defined in app.py, make sure this file is in the root of the files.
Do NOT use: CMD ["python", "app.py"] - Lambda function won't work like that.
Why would you assume that I have not followed the instructions for defining CMD? I have indeed followed them, and have a package.package.function_name as my CMD.
Relevant content
- asked 5 years ago
- asked 4 years ago

I've looked at all of these things already.