Permission denied for gm binaries installed within AWS Lambda
I'm using GraphicsMagick in my Lambda function (NodeJs 8.10) , for that I need to install both:
- the NodeJs library for it gm (latest 1.23.1) [That's fine!]
- and the GM binaries
To get the gm binaries on the Lambda, after some googling/stackingoverflow, get to create this github gist that states what I did briefly as follow:
- Create EC2 instance with Amazon Linux AMI that matches AWS Lambda's runtime.
- Install the gm there, tar it, copy it to my lambda, zipped it, packaged it, and deployed it.
Now the problem is that I got "Stream yields empty buffer" error whenever I used and manipulating method from gm, for that needed to check if my installed binaries there is correct, so added the following in my lambda handler function:
const exec = require('child_process').exec;
exec("gm -help", console.log)
And got the following "Permission denied" error as shown below:
Any clue? Thanks in advance!
Got it solved! Too much details to list here. Gonna close it.
@basimhennawi can you elaborate somewhere else? I too have this use case and issue :)
@basimhennawi Facing the same issue, what was your final folder structure? and can you elaborate a bit on the issue?
