If the first deployment fails, we need to delete the stack to be able to deploy again
I am opening this issue to expose the problem and discuss solutions.
When deploying a CloudFormation (template.yaml) stack for the first time, if it fails for any reason the stack will be left in a broken state (ROLLBACK_FAILED).
It needs to be manually deleted in the CloudFormation dashboard, else other deployments will fail with:
An error occurred (ValidationError) when calling the CreateChangeSet operation: Stack:arn:aws:cloudformation:... is in ROLLBACK_FAILED state and can not be updated.
Solutions?
- a
brefcommand to clean the stack? (maybe abref doctorcommand could help explain the problem as well?) - better documentation?
I like the idea of bref doctor. It could simply return 'have you checked the region?'
'have you checked the region?'
haha that's the easiest way I've seen yet to cover 80% of errors 😄
Tried to deploy the first time (with the region) but it failed as I expected (rarely things work the first time).
I looked at the CloudFormation dashboard and status was: ROLLBACK_FAILED
So after reading this thread I deleted the stack and redeployed and failed again.
I ran "aws cloudformation describe-stack-events --stack-name xxxxxx --region us-east-1" and got a bunch of JSON stuff and the first error was:
"StackId": "arn:aws:cloudformation:us-east-1:xxxxxxx", "EventId": "ArtisanRole-CREATE_FAILED-2019-06-18T05:23:17.448Z", "StackName": "xxxxx", "LogicalResourceId": "ArtisanRole", "PhysicalResourceId": "xxxxx-ArtisanRole-1RVSJ764BUTWX", "ResourceType": "AWS::IAM::Role", "Timestamp": "2019-06-18T05:23:17.448Z", "ResourceStatus": "CREATE_FAILED",
I am using an user with all privileges, this is confusing and totally stuck.
@MickaelTH just so you are aware, there is a new bref deployment command that will help you diagnose what went wrong with the latest deployments. That way you don't have to mess manually with aws cloudformation describe-stack-events.
AFAIK this has been fixed in serverless framework.