I use AWS Lambda to resize my image in s3 bucket to different size options using node js when the image fits in s3 bucket .
He worked until yesterday. Today, when I use the same lambda function, I get the following error:
{ "errorMessage": "Command failed: identify: not authorized `//bucketname.s3.amazonaws.com/imagename.jpg' @ error/constitute.c/ReadImage/454.\n", "errorType": "Error", "stackTrace": [ "", "ChildProcess.proc.on.onExit (/var/task/node_modules/gm/lib/command.js:297:17)", "emitTwo (events.js:87:13)", "ChildProcess.emit (events.js:172:7)", "maybeClose (internal/child_process.js:821:16)", "Socket.<anonymous> (internal/child_process.js:319:11)", "emitOne (events.js:77:13)", "Socket.emit (events.js:169:7)", "Pipe._onclose (net.js:469:12)" ] }
I cannot understand why this phenomenon occurred. All of the above functions of my lambda function below are in async waterfall , to first calculate the aspect ratio, and then convert the image to different size options.
var request=require("request"); function getTheAspectRatio(callback) { gm(s3Url) // I am constructing the image url in the AWS Lambda Function. .size(function(err, size) { if (!err) { //Calculate the Aspect ratio } else if (err) { //Give Back the Error } }); } function getTheImageBuffer(callback) { request(imageUrl, function(err, res, res1) { if (err) { callback(err); } else { buffer = res1; console.log("got the BUffer"); callback(null); } }); } function convertToThumbNail(callback) { //Convert to Thumbnail Image } function convertToFull(callback) { //Convert to Full Image } function convertToBadge(callback) { //Convert to Badge image }
Can someone help in debugging the problem? Iām kind of stuck on this for the last 3 hours. My AWS Lambda is located in the Tokyo region.
source share