Permission denied on function Lamda

Viewed 2144

I get access denied when I run a node.js function on AWS Lamda. 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)"
3 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.

I had this problem as well, but with a Lambda created directly using the AWS Lambda editor. I fixed the issue by doing a new handle file.

Related