const AWS = require('aws-sdk');
AWS.config.loadFromPath('./config.json');
const rekognition = new AWS.Rekognition({apiVersion: '2016-06-27'});
const constants = require('./constants');
const s3BucketName = constants.s3BucketName;
const s3BucketKeyName = constants.s3FacebookBucketKey;
const params = {
Image: {
S3Object: {
Bucket: "mastekinnoations3learning",
Name: "1527119837382460.jpeg"
}
}
};
rekognition.detectFaces(params, function(err, data) {
if (err)
console.log(err, err.stack); // an error occurred
else {
console.log(data); // successful response
}
});
我正在尝试执行上个月成功运行的上述代码,但它突然停止运行,出现错误“InvalidParameterException”。任何我所缺少的帮助都会有很大的帮助!!
我正在使用的图像是这个
https://s3-us-west-2.amazonaws.com/mastekinnoations3learning/1527119837382460.jpeg
详细错误:
{ InvalidParameterException: Request has Invalid Parameters
at Request.extractError (D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\protocol\json.js:48:27)
at Request.callListeners (D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\sequential_executor.js:106:20)
at Request.emit (D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\sequential_executor.js:77:10)
at Request.emit (D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\request.js:683:14)
at Request.transition (D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\request.js:22:10)
at AcceptorStateMachine.runTo (D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\state_machine.js:14:12)
at D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\state_machine.js:26:10
at Request.<anonymous> (D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\request.js:38:9)
at Request.<anonymous> (D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\request.js:685:12)
at Request.callListeners (D:\Saurabh jain\Personal\nodejsprojects\ImageUpload\node_modules\aws-sdk\lib\sequential_executor.js:116:18)