Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied on function Lambda

I get access denied when I run a node.js function on AWS Lambda. I am uploading a zip file which contains the index.js and the node module packets.

Have run through this twice now and still get same error as below so any help is appreciated.

{

"errorMessage": "EACCES: permission denied, open '/var/task/read.js'",

"errorType": "Error",

"stackTrace": [

"Object.fs.openSync (fs.js:549:18)",

"Object.fs.readFileSync (fs.js:393:15)"
like image 287
Anto Samardzic Avatar asked Sep 08 '25 00:09

Anto Samardzic


1 Answers

I got the same problems weeks ago.

Appears that setting file permissions on .js files before zipping solves this error.

Run: filename.js chmod -R 644 in your Terminal

Hope this saves someone else time & effort.

like image 156
Eltomon Avatar answered Sep 10 '25 06:09

Eltomon