AWS SAM "is in ROLLBACK_COMPLETE state ... cannot be updated" in CI
When a SAM stack's first create fails, CloudFormation leaves it in ROLLBACK_COMPLETE. That state cannot be updated, so the next sam deploy is rejected until the empty stack is deleted.
What this error means
sam deploy fails with "Stack:arn:...:stack/my-app/... is in ROLLBACK_COMPLETE state and can not be updated." after a failed initial deploy.
Error: Failed to create/update the stack: my-app, An error occurred (ValidationError)
when calling the CreateChangeSet operation: Stack:arn:aws:cloudformation:us-east-1:...:
stack/my-app/... is in ROLLBACK_COMPLETE state and can not be updated.Common causes
The first deploy failed and rolled back
ROLLBACK_COMPLETE only occurs after a failed initial create, leaving a resourceless stack that blocks updates.
The original failure cause persists
Deleting and redeploying without fixing the first CREATE_FAILED cause reproduces the rollback.
How to fix it
Delete the failed stack and redeploy
- Fix the root CREATE_FAILED cause from the stack events.
- Delete the ROLLBACK_COMPLETE stack with
sam delete. - Run
sam deployagain for a clean create.
sam delete --stack-name my-app --no-prompts
sam deploy --resolve-s3 --capabilities CAPABILITY_IAM --no-confirm-changesetInspect why the first create failed
Read the events so the redeploy does not roll back identically.
aws cloudformation describe-stack-events --stack-name my-app \
--query "StackEvents[?ResourceStatus=='CREATE_FAILED']"How to prevent it
- Fix the first CREATE_FAILED cause before retrying.
- Validate templates with
sam validatebefore deploy. - Automate deletion of ROLLBACK_COMPLETE stacks in CI.