AWS Lambda "Runtime.InvalidEntrypoint" in CI
A container-image Lambda failed to start because its entrypoint is not a valid Lambda runtime interface client, or the CMD does not name a resolvable handler. The runtime rejects the image before any invocation runs.
What this error means
Invoking a container-image function returns "Runtime.InvalidEntrypoint" (sometimes "InvalidEntrypoint: ... exec format error" or a missing runtime interface client). It reproduces on every invoke of that image.
{
"errorType": "Runtime.InvalidEntrypoint",
"errorMessage": "RequestId: ... Error: fork/exec /lambda-entrypoint.sh: exec format error"
}Common causes
Wrong architecture image
The image was built for arm64 but the function is configured x86_64 (or vice versa), so the entrypoint fails with an exec format error.
Missing runtime interface client or CMD
A custom base image has no AWS Lambda Runtime Interface Client, or the CMD does not name the handler, so the runtime cannot dispatch invocations.
How to fix it
Match the build platform to the function architecture
- Confirm the function
Architecturesvalue (x86_64 or arm64). - Build the image for the same platform.
- Push and re-invoke.
docker buildx build --platform linux/arm64 -t my-fn .Set a valid CMD/handler on the image
Use an AWS base image and point CMD at your handler, or install the runtime interface client.
FROM public.ecr.aws/lambda/nodejs:20
COPY handler.mjs ${LAMBDA_TASK_ROOT}
CMD ["handler.handler"]How to prevent it
- Build container-image functions for the configured architecture.
- Base custom images on the AWS Lambda base images or install the RIC.
- Set CMD to the handler so the runtime can dispatch.