Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws lambda docker fork/exec permission denied

Tags:

docker

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?

like image 329
user1275607 Avatar asked Sep 12 '25 21:09

user1275607


1 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.

like image 67
JerryInCBus Avatar answered Sep 14 '25 10:09

JerryInCBus