SAM Doctor

ERROR REFERENCE

Another operation is already in progress (OperationInProgressException)

Two deployments raced on the same stack — a teammate, a second CI run, or a console operation — and CloudFormation rejected the new one until the in-flight operation finishes. Nothing is broken; the stack is just busy.

WHAT IT MEANS

What this error means

CloudFormation serializes operations per stack. A second deploy arriving while the first is running is refused outright rather than queued — which is safe, but fails the second pipeline run. Note that an ordinary UPDATE_IN_PROGRESS progress event in a healthy deploy is not this failure; the refusal wording is.

FIX

How to fix it

  1. Find the in-flight operation (read-only):
    aws cloudformation describe-stack-events --stack-name my-app
    The newest events show what is running and who started it. Let it finish; most updates complete in minutes.
  2. Serialize CI deploys per stack. In GitHub Actions, a concurrency group keyed by stack name makes the race impossible:
    concurrency:
      group: deploy-my-app
      cancel-in-progress: false
  3. Check for console operations. A manual update or delete started in the console blocks pipeline deploys exactly the same way.

AUTOMATE THE TRIAGE

Diagnose this automatically

SAM Doctor recognizes the refusal wording (high confidence) and keeps it distinct from rollback states and normal progress events. Runs locally; no AWS access, no log upload.

python -m pip install sam-doctor
sam-doctor diagnose deployment.log --format markdown

RELATED