aws-samples / amazon-rekognition-video-analyzer

A working prototype for capturing frames off of a live MJPEG video stream, identifying objects in near real-time using deep learning, and triggering actions based on an objects watch list.
Other
368 stars 158 forks source link

pynt createstack failed #3

Closed stardev24 closed 6 years ago

stardev24 commented 7 years ago

pynt createstack failed because of Status reason: The following resource(s) failed to delete: [EnrichedFrameTable] in cloudformation.Help needed.

moanany commented 7 years ago

Hello!

This could happen when one of the stack's resources fail to create, so, CloudFormation attempts to rollback the stack creation immediately. The rollback process may fail to delete the DynamoDB table if it was still being created when rollback executes.

I'd suggest the following:

1) Find out which resources are failing to create and why from the "Events" section in the CloudFormation console. Address the root cause of failure.

A common cause, for example, is that the commands "pynt package lambda" and then "pynt deploy lambda" were not issued prior to "pynt createstack", and thus, an S3 bucket used by the CloudFormation stack was not found. This leads to stack creation failure. It could also lead to stack rollback failure, if the DynamoDB table was still being created.

2) Check stack status in the CloudFormation console. The stack status may be either "ROLLBACK_COMPLETE" or "ROLLBACK_FAILED" at this point. Manually delete the stack.

3) Re-run "pynt createstack" after the root cause identified in step 1 is addressed.

Hope this helps. I'll keep this issue open in the meantime.

stardev24 commented 7 years ago

HI,

Thanks for quick response.I have created lambda package and deployed to s3 bucket.But after that only I am using pynt createstack.Here by providing the logs create package error

lambda package

I have followed all the steps one by one.Only getting error at this create package step. Looking forward for your support.

stardev24 commented 7 years ago

I have tried multiple times manual stack deletion and executing the create stack command.But every time I am getting status as ROLLBACK_FAILED. Hope the logs provided above will help you to understand the issue.

moanany commented 7 years ago

Hello,

To fix this, delete FrameFetcherLambdaExecutionRole (along with ImageProcessorLambdaExecutionRole if it exists, too) using the IAM console. From the event log you shared, CloudFormation attempts to create the role while it already exists. This could happen, for example, if you attempted to create the stack in another region. IAM resources are global and the roles have names (RoleName attribute) in the CFN template.

A temporary solution is to delete those already-created resources manually from your account using the IAM console. You can also manually delete the stack from other regions. Then, recreate the stack.

A better fix would be to omit RoleName in the CFN template from both execution roles (simply commenting out or removing the property). I do have to update and test the CFN template before pushing such a change to this repo. You may want to give it a try in the meantime.

stardev24 commented 7 years ago

Hello,

I have tried the above mentioned way,But same problem.Can you please recheck the Cloudformation template and push to git so that it will be very useful.Kindly help as soon as possible.

Thanks

moanany commented 7 years ago

Hello,

To help us understand what’s going on, could you please post screenshots of the CFN event log during attempted deletion, after you manually deleted the resources pointed out above?

Thanks.

moanany commented 7 years ago

I updated the CloudFormation template for more resiliency to resource creation failures. Closing this issue for now. Please feel free to post any additional questions/updates and I'll re-open.

stardev24 commented 7 years ago

Thanks,Let me check and if problem exist I will get back to you.

lhamregit commented 6 years ago

I tried the same steps as stardev24 and got the exact same result. Looked through the comments and did everything that was recommended (like checking the roles in IAM). Everything is according to the instructions and still seeing the error when creating.

moanany commented 6 years ago

Hello,

Can you post the details of the error? Screenshots and error message(s) would help.

Thanks

lhamregit commented 6 years ago

screen shot 2017-11-28 at 5 40 06 pm

This is the log from cloudformation

moanany commented 6 years ago

Hey,

Thank you for the screenshot. It shows that the first error reported by CloudFormation (i.e. "lh-vid2 already exists") is what causes the stack creation to roll back. The name you specify for FrameS3Bucket must not be of an existing S3 bucket.

lhamregit commented 6 years ago

awesome, thank you! I seem to have missed that constraint. Works like a charm now 👍

moanany commented 6 years ago

You're welcome!

ghost commented 6 years ago

image my condition is similar I believe after following the steps. It is with the lambdaroles. Please help me where to delete/comment to make the build success