How can I troubleshoot the "Runtime.InvalidEntrypoint" error for my Lambda function that's from a Docker image?

2 minuto de leitura
0

I received a "Runtime.InvalidEntrypoint" error when I try to create an AWS Lambda function from a Docker image.

Resolution

When the entry in the Lambda function configuration is incorrect, you receive the Runtime.InvalidEntrypoint error.

To resolve this issue, check the following configuration settings for your Lambda function:

  • Verify that the ENTRYPOINT and CMD to your container image include the absolute path as the location. Also, the image can't contain a symlink as the ENTRYPOINT.

  • Make sure that the ENTRYPOINT is correct in the Lambda function's configuration. The ENTRYPOINT must match the command in the container's Dockerfile that's used for the runtime.

  • Verify that the container image is pushed to the correct Amazon Elastic Container Registry (Amazon ECR).

  • Make sure that the Docker image's architecture and the Lambda function are the same. Lambda supports arm64 and x86_64 instruction set architectures. When you're building the container image, be sure to use either the linux/amd64 or linux/arm64 platform.
    Example:

    docker build platform linux/amd64 -t docker-image:test
  • When the Lambda deployment package doesn't have the correct security permissions, you receive a permission denied error along with the Runtime.InvalidEntrypoint error. To verify the correct permissions, see Unix permissions symbolic notation on the Wikipedia website. For all files within a Lambda deployment package, the correct permissions setting is 644. For folders within a deployment package, the correct permissions setting is 755. For more information, see How do I troubleshoot "permission denied" or "unable to import module" errors when I upload a Lambda deployment package?

Related information

How do I create a Lambda layer using a simulated Lambda environment with Docker?

Troubleshoot container image issues in Lambda

How do I use container images with Lambda?

AWS OFICIAL
AWS OFICIALAtualizada há um mês
2 Comentários

Recieved the error "rror: fork/exec /lambda-entrypoint.sh: exec format error Runtime.InvalidEntrypoint"

Was able to resolve the error after adding respective architecture tag in docker file for runtime image "public.ecr.aws/lambda/python:3.11-x86_64",

respondeu há 7 meses

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
MODERADOR
respondeu há 7 meses