aws lambda docker fork/exec permission denied

Viewed 627

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?

2 Answers

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.

Adding RUN chmod 777 /root in Dockerfile worked for me .

Related