Thanh Nguyen Van
Thanh Nguyen Van

Reputation: 11762

ValidationError Stack:arn aws cloudformation stack is in ROLLBACK_COMPLETE state and can not be updated

When I deploy using cloudformation aws cloudformation deploy --region $region --stack-name ABC

I get the error:

An error occurred (ValidationError) when calling the CreateChangeSet operation: Stack:arn:aws:cloudformation:stack/service/7e1d8c70-d60f-11e9-9728-0a4501e4ce4c is in ROLLBACK_COMPLETE state and can not be updated.

Upvotes: 188

Views: 156581

Answers (4)

user727412
user727412

Reputation: 11

the case is that the S3 bucket is unique globally, same happened to me I was getting the same error while I was using the CloudFormation.

in my case, S3 bucket name was not unique in my case, it was already created, i change then name of the bucket and it worked.

Upvotes: 1

ashique
ashique

Reputation: 1285

2 solutions 1.you have to manually delete all the objects in the s3 (if still th error occurs ,Stack:arn:aws:cloudformation:eu-west-3:624140032431:stack/as*****cbucket/f57c54f0-618a-11ec-afd7-06fc90426f3e is in ROLLBACK_COMPLETE state and can not be updated., move to second solution) 2.create a new bucket to continue

Upvotes: 1

404
404

Reputation: 8552

This happens when stack creation fails. By default the stack will remain in place with a status of ROLLBACK_COMPLETE. This means it's successfully rolled back (deleted) all the resources which the stack had created. The only thing remaining is the empty stack itself. You cannot update this stack; you must manually delete it, after which you can attempt to deploy it again.


If you set "Rollback on failure" to disabled in the console (or set --on-failure to DO_NOTHING in the CLI command, if using create-stack), stack creation failure will instead result in a status of CREATE_FAILED. Any resources created before the point of failure won't have been rolled back.

If instead you were deploying updates to an existing (successfully created) stack, and the updates failed but were successfully rolled back, it will go back into its previous valid state (with a status of UPDATE_ROLLBACK_COMPLETE), allowing you to reattempt updates.


As @SteffenOpel points out, you can now specify that a stack should be deleted on failure by setting the --on-failure option (for create-stack only, not deploy) to DELETE in the CLI. This option is not yet available in the console at the time of writing (13/11/20).

Upvotes: 249

SRi
SRi

Reputation: 1236

Run the following AWS CLI command to delete your stack:

aws cloudformation delete-stack --stack-name <<stack-name>>

It may take less than a minute to delete your stack, and then try re-deploying it.

Upvotes: 97

Related Questions