-2

I'm getting errors across my whole aws mainly permission related but when I check my policies are attached as instructed in the AWS docs. i want to deploy to Deeplens 2019 edition camera but nothing seems to work here is the lambda error when i run test.

Response
{
  "errorMessage": "An error occurred (InvalidS3ObjectException) when calling the DetectLabels operation: Unable to get object metadata from S3. Check object key, region and/or access permissions.",
  "errorType": "InvalidS3ObjectException",
  "stackTrace": [
    "  File \"/var/task/greengrassHelloWorld.py\", line 35, in lambda_handler\n    response = rekognition.detect_labels(Image=image, MaxLabels=123, MinConfidence=50)\n",
    "  File \"/var/runtime/botocore/client.py\", line 357, in _api_call\n    return self._make_api_call(operation_name, kwargs)\n",
    "  File \"/var/runtime/botocore/client.py\", line 676, in _make_api_call\n    raise error_class(parsed_response, operation_name)\n"
  ]
}

i have done most of the suggested fixes including region settings and policies

NullVoid0
  • 1
  • 3
  • 1
    `Occurs mostly when the object is not present` or `when the object name is incorrect` or `the lambda does not have access to S3`. – Prabhat Mishra Apr 25 '21 at 13:52
  • hi @PrabhatMishra thank you for you reply, im assuming the object would be the bucket? how would i ensure that lambda has the appropriate rights to S3? cause i have added the s3 to lambdafunction role and policies in various way but mainly fullaccess. or would it be here? "s3": { "configurationId": "testConfigRule", "object": { "eTag": "0123456789abcdef0123456789abcdef", "sequencer": "0A1B2C3D4E5F678901", "key": "images/", "size": 1024 }, – NullVoid0 Apr 25 '21 at 14:05
  • i also get this error when i try to open an image directly from s3 ` AccessDenied Access Denied 23G2PFCHASBWDHZP kuqyDBk44YWW+JqzyswEzLkRrGNJwF59WpgkztvgTAnbWPtFnXlWuupcAIm2I3lHJdOy35zXs0g= ' – NullVoid0 Apr 25 '21 at 14:10
  • The object is the file present in the S3 Bucket. – Prabhat Mishra Apr 25 '21 at 14:15

1 Answers1

1

Make sure to check below things:

1.LAmbda role have sufficient access to connect S3.
2.THe object which you are accessing is present in S3(Check the prefix what you are using in code).
3.Any bucket policy in place which might cause blocking access.

Prabhat Mishra
  • 951
  • 2
  • 12
  • 33
Sujith
  • 11
  • 4