Skip to content
Latchkey

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.

sam
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

  1. Fix the root CREATE_FAILED cause from the stack events.
  2. Delete the ROLLBACK_COMPLETE stack with sam delete.
  3. Run sam deploy again for a clean create.
Terminal
sam delete --stack-name my-app --no-prompts
sam deploy --resolve-s3 --capabilities CAPABILITY_IAM --no-confirm-changeset

Inspect why the first create failed

Read the events so the redeploy does not roll back identically.

Terminal
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 validate before deploy.
  • Automate deletion of ROLLBACK_COMPLETE stacks in CI.

Frequently asked questions

What causes ""ROLLBACK_COMPLETE state ... cannot be updated""?
ROLLBACK_COMPLETE only occurs after a failed initial create, leaving a resourceless stack that blocks updates.
How do I fix "ROLLBACK_COMPLETE state ... cannot be updated"?
Delete the failed stack and redeploy

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card