aws-lambda-container-julia icon indicating copy to clipboard operation
aws-lambda-container-julia copied to clipboard

`/var/runtime/bootstrap: Permission Denied`

Open mattBrzezinski opened this issue 4 years ago • 3 comments

I was attempting to modify this repo for an internal project, and ran into this issue. I then decided to just build and push up master here. When I attempt to test run the Lambda function on AWS I get the error:

START RequestId: e053eccc-2487-4b5b-891c-a6102b0f9c05 Version: $LATEST
/lambda-entrypoint.sh: line 14: /var/runtime/bootstrap: Permission denied
/lambda-entrypoint.sh: line 14: exec: /var/runtime/bootstrap: cannot execute: Permission denied
END RequestId: e053eccc-2487-4b5b-891c-a6102b0f9c05
REPORT RequestId: e053eccc-2487-4b5b-891c-a6102b0f9c05	Duration: 2.50 ms	Billed Duration: 3 ms	Memory Size: 4096 MB	Max Memory Used: 7 MB	
RequestId: e053eccc-2487-4b5b-891c-a6102b0f9c05 Error: Runtime exited with error: exit status 126
Runtime.ExitError

I've tried to do a chmod +x bootstrap after this in the Dockerfile. Same result 😕.

It seems that creating this bootstrap file which does a cd /var/task and runs you script is the correct thing to do according to the documentation.

mattBrzezinski avatar Sep 08 '21 19:09 mattBrzezinski

Modifying the source a bit. The result of ls -la /var/runtime/bootstrap

-rwxr-xr-x 1 root root 185 Sep 8 17:01 /var/runtime/bootstrap

mattBrzezinski avatar Sep 08 '21 20:09 mattBrzezinski

I added a Pull-request fixing this in the dockerfile (#4). Please noe that this would need to run docker build with the DOCKER_BUILDKIT=1 flag since chmod-ing something is a feature that requires BUILDKIT enabled (see eg here).

Benvorth avatar Nov 25 '22 13:11 Benvorth

I'm not able to see this problem with my test today... I was able to run it properly from AWS without doing any chmod.

When I check out the repo, the bootstrap file already has permission 0775. I think the COPY command should have carried over the executable flag. Right?

(base) ✔ ~/AWS/aws-lambda-container-julia [tk/julia-1.8-update|✔] 
03:14 $ ls -l
total 40
-rwxrwxr-x 1 ec2-user ec2-user  186 Jan  3 02:16 bootstrap
-rw-rw-r-- 1 ec2-user ec2-user 1201 Jan  3 03:02 Dockerfile
-rw-rw-r-- 1 ec2-user ec2-user 1102 Jan  3 02:16 LICENSE
-rw-rw-r-- 1 ec2-user ec2-user 3227 Jan  3 02:16 main.jl
-rw-rw-r-- 1 ec2-user ec2-user   71 Jan  3 02:16 Manifest.toml
-rw-rw-r-- 1 ec2-user ec2-user  257 Jan  3 02:16 Project.toml
-rw-rw-r-- 1 ec2-user ec2-user 3153 Jan  3 03:12 README.md
drwxrwxr-x 2 ec2-user ec2-user 4096 Jan  3 02:16 scripts
drwxrwxr-x 2 ec2-user ec2-user 4096 Jan  3 02:16 src
drwxrwxr-x 2 ec2-user ec2-user 4096 Jan  3 02:16 test

tk3369 avatar Jan 03 '23 03:01 tk3369