New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rekognition image assessment failing #2
Comments
Try to increase lambda |
Have you tested the rekognition-image-assessment in isolation, or have you only tested it as part of a step function call? Try setting the timeout to 10 seconds, as @dimitrystd suggests. You may not be giving Rekognition enough time to finish processing. Let us know if that helps! |
I had only tested it as part of the function call. "errorMessage": "Error in [nodemailer-send-notification].\r Function input [{\n "Alert": "true",\n "Labels": [\n {\n "Name": "Human",\n "Confidence": 99.31401824951172\n },\n {\n "Name": "People",\n "Confidence": 99.31543731689453\n },\n {\n "Name": "Person",\n "Confidence": 99.31543731689453\n },\n {\n "Name": "Man",\n "Confidence": 85.11573028564453\n },\n {\n "Name": "Portrait",\n "Confidence": 63.546775817871094\n },\n {\n "Name": "Selfie",\n "Confidence": 63.546775817871094\n },\n {\n "Name": "Female",\n "Confidence": 52.66830825805664\n }\n ],\n "bucket": "motion-storage",\n "key": "upload/How to enrage a geek.jpg"\n}].\r Error [Error: Invalid status code 403]." I will re-check the code and re-build the zip file, test and let you know. |
@hylton1995 great news! @dimitrystd thanks for a good suggestion! I'll add a note to the instructions so that the next person doesn't have to struggle with the same issue :) |
@markwest1972 I had this error too, and you covered this thing in description but may i ask to make it more clear.
Can you show how exactly this policy should look? Because with new aws console you have to provide policy. An example, my one look like But i think it can be more strict (like allow access only for particular lambda or user\role from my aws account)
But example above doesn't work. Let me know if you found root cause why special permissions are required. P.S. Also |
@dimitrystd I'll definitely have a look at this. I'm flat out with work and family at the moment, so it may take a couple of days. |
@dimitrystd in the mean time, here are the permissions as I have defined them. Note that I haven't defined a bucket policy. @hylton1995 this may resolve your issue. |
Have updated the instructions for setting the S3 permissions. |
@markwest1972 apologies for the late reply, its been a hectic week, and I don't seem to be getting notifications of these post updates! Error: Transport setup: Mail Options: [\n {\n "Name": "Human",\n "Confidence": 99.31401824951172\n },\n {\n "Name": "People",\n "Confidence": 99.31543731689453\n },\n {\n "Name": "Person",\n "Confidence": 99.31543731689453\n },\n {\n "Name": "Man",\n "Confidence": 85.11576843261719\n },\n {\n "Name": "Portrait",\n "Confidence": 63.54676055908203\n },\n {\n "Name": "Selfie",\n "Confidence": 63.54676055908203\n },\n {\n "Name": "Female",\n "Confidence": 52.668296813964844\n }\n]', attachments: [ { filename: 'How to enrage a geek.jpg', path: 'https://s3-eu-west-1.amazonaws.com/motion-storage/upload/How to enrage a geek.jpg' } ] } I have tried with these permissions as well, and the same result. Does either of the sending or receiving mail domains need to be verified in SES? |
Quick update, as @dimitrystd suggested, I added a policy to the s3 bucket, see below. This policy obviously isn't very secure, so I assume I would need to change the action from "", to the individual Gets and Lists? |
@hylton1995 Great to hear that everything is now working as expected! I'm going to try and find out why you guys need to set a policy, when I don't have to. Could be I've tweaked a setting somewhere else and forgot to document it. As for making the access to S3 more secure, I agree that this should be done. I'll try and look at it this week. I'm heading to a couple of conferences so should have some available time in the evening. |
Gonna close this issue now as the root cause is fixed. |
@hylton1995, @dimitrystd : Regarding the S3 Bucket Policy - this should be set to the ARN for the IAM Role associated with the Lambda Function. I've changed README.MD to reflect this. |
Hi there
Firstly thank you for this project!
I have been trying to get this working for a few weeks now, and though maybe you could suggest what I am doing wrong here.
Everything works fine up to the end of the first step-engine function (rekognition-image-assessment). According to the step engine the function completed (is green), and then directs to the nodemailer-error-handler (which is red).
The output of the rekognition-image-assessment function lists: {"Error":"Lambda.Unknown","Cause":"The cause could not be determined because Lambda did not return an error type."}.
I have added a few console.log statements to the rekognition-image-assessment code and tested, and it gets successful params, and I can output the request variable after the if/else loop. However the console.log statements inside the if/else loop never log, and I am not 100% sure how to read the request var output.
Is this something you came across at all?
Apologies for this request, but this is my first attempt with AWS, and my last programming experience was VN.net many years ago.
Thanks!
The text was updated successfully, but these errors were encountered: