'aws lambda docker fork/exec permission denied

I am trying to use AWS lambda with docker container. The container is built starting from ubuntu:latest

When running test with AWS lambda console, I get following error:

Launch error: fork/exec /root/miniconda3/bin/python: permission denied
Entrypoint: [/root/miniconda3/bin/python,-m,awslambdaric]

The /root/miniconda3/bin/python and awslambdaric files do have correct permission.

Any idea what could be reason?



Solution 1:[1]

I just ran into a similar issue where /root had drwxr-x--- permissions (i.e. "others" could not read or execute). When this runs under Lambda, it doesn't run as root so it cannot access directories that are not readable/executable by "other".

When I added "RUN chmod o+rx /root" to my Dockerfile, my lambda ran successfully.

BTW, also check that /root/miniconda3/bin/python is not a symbolic link. I read somewhere that that could also cause this error.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JerryInCBus